Adding line breaks in ipython

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

    A easy way of doing it is using the ;\ operator. ; to signal that its the end of a command and \ to indicate the the command follows in a new line as follows:

    In[4]: password = "123";\
           username = "alpha"
    

    This will let you have multiple line commands in ipython without invoking the editor

提交回复
热议问题