I need to import the readline functionality in a program written in python. I am currently using version 2.7 and the 3rd party packages I have seen only work up to version 2.6. Does anyone know of a 3rd party readline package for Windows with Python 2.7?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I believe pyreadline was designed just for this.
easy_install pyreadline
or:
pip install pyreadline
http://pypi.python.org/pypi/pyreadline
Also, use the following for forward/reverse compatibility:
try:
import readline
except ImportError:
import pyreadline as readline