views:

76

answers:

2

On bash or Window's Command Prompt, we can press the up arrow on keyboard to get the last command, and edit it, and press ENTER again to see the result.

But in Python's IDLE 2.6.5 or 3.1.2, it seems if our statement prints out 25 lines, we need to press the up arrow 25 times to that last command, and press ENTER for it to be copied?

Or use the mouse to pinpoint that line and click there, and press ENTER to copy? Is there a faster way?

+2  A: 

just use Alt+P to go up. Similarly, Alt+N could be used to go down.

SilentGhost
ALT P and ALT N, i tried it... it seems like it is designed to see how used to you are spreading your index and middle fingers apart.
動靜能量
use any one of your thumbs to press the ALT key, that will make this bug go away ! and remember that the keyboard was designed to use every fingers of your 2 hands.
Adrien Plisson
+4  A: 

I think you are looking for the history-previous action, which is bound to alt+p by default.

You can remap it in Options->Configure IDLE->Keys

Incidentally, why don't you try a better (less ugly, for starters) shell like bpython or ipython?

shylent