I want a 64-bit python interpreter on my Mac so I had to rebuild from source. However, with my own custom build interpreter I run into issues when I try to navigate when I run the interpreter from inside a shell. Typing python into the bash shell results in the familiar:
Python 2.6.3 (r263:75183, Oct 23 2009, 14:23:25)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
However, when I try to navigate with left-arrow and right-arrow, I get weird characters:
Python 2.6.3 (r263:75183, Oct 23 2009, 14:23:25)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^[[A^[[A^[[A^[[D^[[C^[[C^[[A^[[B^[[D^[[C
This 开发者_如何转开发does not occur in Apple's default interpreter.
What is causing this? How can I fix it?
Sounds like your custom build didn't include readline. Should be a simple config change and rebuild, check here for more info.
Installing the GNU readline library from here, and rebuilding python fixes the problem.
精彩评论