在IPython中添加换行符

9 浏览
0 Comments

在IPython中添加换行符

在iPython中,如果我要引入一个for循环或者任何多行命令,我如何在之后添加行呢?我运行了以下代码:

for row in table.find_all('tr'):
    cells = row.find_all('td')
    for c,cell in enumerate(cells):
        print c,":",cell.get_text().strip()
    try:
        this = cells[0]
        that = cells[1]
        the_docket = cells[2]
        other_thign = cells[3]
        jumble = re.sub('\s+',' ',str(cells[5])).strip()            
    except:
        "Nope"

然后我意识到需要添加一行代码,但是我不能简单地在iPython中按下"enter"键,因为那会运行该命令。所以我能在iPython中编辑这个多行命令吗?

0