IPython - cycle through blocks in input history?

送分小仙女□ 提交于 2021-02-10 07:12:40

问题


Say I input the following:

def foo():
    print(2)

Then later, when I want to edit my function, I press the Up arrow key to rewrite it, and that cycles through my inputs one line at a time (i.e. first it shows print(2), then def foo():). Is there any way to make it cycle through blocks of code the way IDLE does it?


回答1:


I have this problem with an earlier version of iPython on Linux (11 I think). New versions do not do this.

I currently still use 11, and my solution was to just use the iPython qtconsole instead which does what you want. I would assume it would do the same on Windows.




回答2:


Since IPython has stopped using readline, this issue has come back, the "solution" is to use PageUp and PageDown instead C-up and C-down.



来源:https://stackoverflow.com/questions/11802555/ipython-cycle-through-blocks-in-input-history

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!