syntax highlighting in ipython console

后端 未结 2 1111
北海茫月
北海茫月 2021-01-04 12:17

I am using ipython both in qtconsole and in the terminal

In ipython-qtconsole, when I type import pandas as pd the

相关标签:
2条回答
  • 2021-01-04 12:22

    Yes, if you use IPython 5.0 or above, It makes uses of Python Prompt Toolkit which does highlight code as you type, as well as support real, and sane multi-line edition.

    To upgrade use :

    pip install  ipython --upgrade
    

    This is based on the work of Jonathan Slenders on ptpython:

    python -m pip install ptpython
    

    which provide 2 commands: ptpython and ptipython which should syntax highlight in your terminal. ptipython is a proof of concept so will likely miss some functionality of IPython, but push the interface a bit further.

    Note that jupyter-console, which can connect to IPython as a kernel will also make use of prompt toolkit and highlight code as you type.

    0 讨论(0)
  • 2021-01-04 12:25

    Jupyter, ipython's spin-off for notebooks, provides the command jupyter console, which is precisely what you (and I) are looking for.

    0 讨论(0)
提交回复
热议问题