How to repeat last command in python interpreter shell?

后端 未结 26 1178
一个人的身影
一个人的身影 2020-11-29 16:43

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
         


        
26条回答
  •  温柔的废话
    2020-11-29 17:05

    I don't understand why there are so many long explanations about this. All you have to do is install the pyreadline package with:

    pip install pyreadline
    
    sudo  port install py-readline (on Mac)
    

    (Assuming you have already installed PIP.)

提交回复
热议问题