How do I repeat the last command? The usual keys: Up, Ctrl+Up, Alt-p don\'t work. They produce nonsensical characters.
(ve)[kakarukeys@localhost ve]$ python
Ctrl+p is the normal alternative to the up arrow. Make sure you have gnu readline enabled in your Python build.
I find information that I copied below answer the question
Adapt yourself to IDLE: Instead of hitting the up arrow to bring back a previous command, if you just put your cursor on the previous command you want to repeat and then press "enter", that command will be repeated at the current command prompt. Press enter again, and the command gets executed.
Force IDLE to adapt itself to you: If you insist on making the arrow keys in the IDLE command prompt window work like those in every other command prompt, you can do this. Go to the "Options" menu, select "Configure IDLE", and then "Keys". Changing the key that is associated with the "previous command" and "next command" actions to be the up arrow, and down arrow, respectively.
source
Using arrow keys to go to the start of the command and hitting enter copies it as the current command.
Then just hit enter to run it again.
ALT + p works for me on Enthought Python in Windows.
it is control + p in Mac os in python 3.4 IDEL
Up arrow works for me too. And i don't think you need to install the Readline module for python builtin commandline. U should try Ipython to check. Or maybe it's the problem of your keybord map.