Adding line breaks in ipython

前端 未结 7 689
长发绾君心
长发绾君心 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:33

    You can use ctrl+on (i.e. press the control button and enter the characters 'o', 'n' while holding it). You can also do it in two steps - ctrl+o ctrl+n but I find the former easier.

    • ctrl-o - enter the multiline mode
    • ctrl-n - access command history going forward. But since there is no forward history, cursor just moves to the next line.

    I verified that it works with both IPython 5.3.0 and IPython 7.3.0 on a machine running git bash 2.18.0 + windows 7.

提交回复
热议问题