Adding line breaks in ipython

前端 未结 7 672
长发绾君心
长发绾君心 2020-12-12 14:38

If introduce a for loop in iPython, or any multi-line command, how do I go back and add lines to it? I ran this:

for row in table.find_all(\'tr\'):
    cells         


        
相关标签:
7条回答
  • 2020-12-12 15:44

    For completeness: newer IPython versions (0.11+) have a very nice graphical console which allows you to navigate your code with the arrows and even reposition the cursor with the mouse.

    In multi-line statements, some keys take on a special function (arrows to navigate, Enter to insert a line break and others). You'll have to position the cursor at the end of the last line of the statement in order to get default behaviour, e.g. get the Up arrow to mean "previous statement" instead of "move the cursor to the previous line". Or get Enter to mean "execute code" instead of "insert line break in the middle of code".

    The documentation on it is a bit sparse and fragmented in different pages, so here are the essential three links for getting started with it:

    1. Intro to the Qt Console

    2. Configuring IPython using nice per-user profile files instead of command line arguments

      You are interested in the ipython_qtconsole_config.py

    3. How to get an ipython graphical console on Windows 7?

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