问题
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