添加 Readline 功能而无需重新编译 Python
我最近升级到 Ubuntu 10.04 LTS 并刷新了我的 Python 环境。我从源代码安装了Python 2.7。不幸的是,我没有注意到Setup.dist默认情况下注释掉了readline行——默认情况下,没有安装readline支持。我现在使用 Python 解释器作为 REPL,以至于常量 ^[[A 和 ^[[D 非常令人讨厌。
我可以快速添加 readline 支持,还是必须再次重新编译 Python?似乎应该有一种快速、理智的方法来做到这一点,但我不知道这样的方法。
I recently upgraded to Ubuntu 10.04 LTS and refreshed my Python environment. I installed Python 2.7 from source. Unfortunately, I didn't notice that Setup.dist has the readline line commented out by default - by default, there is no readline support installed. I'm now using the Python interpreter as a REPL enough that the constant ^[[A and ^[[D are very obnoxious.
Can I add readline support quickly, or do I have to actually recompile Python again? It seems like the sort of thing where there should be a quick, sane way to do it, but I don't know such a way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个独立的 gnureadline 包可用,您可以使用 setuptools 安装它
您也可以考虑使用 ipython 代替。
There's a standalone gnureadline package available, you can install it using setuptools
You might also consider using ipython instead.