How to repeat last command in python interpreter shell?

后端 未结 26 1228
一个人的身影
一个人的身影 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

    If you use Debian Jessie run this to fix your system installation 2.7.9

    sudo apt-get install libncurses5-dev libncursesw5-dev
    

    To fix my other 3.5.2 installation which I installed with pyenv :

    pip install readline
    

    Sources:

    [1] https://www.cyberciti.biz/faq/linux-install-ncurses-library-headers-on-debian-ubuntu-centos-fedora/

    [2] https://github.com/yyuu/pyenv/issues/240

    [3] https://stackoverflow.com/a/40229934/332788

提交回复
热议问题