Adding line breaks in ipython

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

    Been suffering this problem for a while. I just found that when using Ctrl-qCtrl-j (That's lowercase Q, J, no need to hold the shift key) will add a linefeed to an existing IPython edit session.

    for li in some_list: print(li)    
    

    Moving the cursor after the colon and pressing Ctrl-qCtrl-j

    for li in some_list:
    print(li)
    

    IPython: 5.2.1, iTerm2: 3.0.15, macOS: 10.12.6

提交回复
热议问题