进入 Python 交互模式,按下 Delete/Backspace 键,会出现 ^H
字符
解决方式:
1. 进到 Python 的Modules目录
[[email protected] Python-2.7.12]# pwd
/root/Python-2.7.12
[[email protected] Python-2.7.12]# cd Modules/
2. 取消文件中 readline 部分对应的注释
vim Setup
readline readline.c -lreadline -ltermcap
3.重新编译Python
[[email protected] Python-2.7.12]# pwd
/root/Python-2.7.12
[[email protected] Python-2.7.12]#./configure
[[email protected] Python-2.7.12]#make && make install
时间: 2024-10-13 20:49:15