Python shell 中的控制字符

Control characters in Python shell

我在使用 Python 交互式 shell 时遇到问题。

我喜欢 emacs 风格的键绑定,但是当我键入 <ctrl> A<ctrl> K 时,它会回显 ^A^K。喜欢:

:)[12:16]root:~ # python
Python 2.7.9 (default, May 15 2015, 01:13:44)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print ^A^K^H

是不是readline库的问题?我已经更新了 readline,但似乎没有帮助。

安装 readline 开发包并重建并重新安装 Python。