有时我会在ipython
中输入一个很长的陈述In [4]: def foo():
...: a
...: bery # here's the error
...: long
...: function
...: definition
...: that
...: has
...: some
...: error
...: at
...: the
...: top
...:
我希望能够修复错误并提交功能,但我的工作流程看起来像这样
In [7]: def foo():
...: a
...: very # 2) FIXED - I want to be able to ENTER from this line
...: # 3) but instead I get a newline
...: long
...: function
...: definition
...: that
...: has
...: some
...: error
...: at
...: the
...: top
...: # 1) I have to start here and scroll all the way to the top
...: # 4) so now I have to scroll all the way down here to ENTER the fixed function
...:
关于如何
的任何建议答案 0 :(得分:0)
要从块中的任何位置提交单元格,请按ESC + return。
我不确定导航到代码的顶部(我自己也在想,这就是我发现你的问题的方法)。我发现当回滚历史记录然后遇到长块时,这尤其成问题。
编辑:如果它有用,另一个有用的技巧是Ctrl + O在同一个单元格中输入一个新行,无论iPython是否需要。 ESC +返回的反面。