2009-10-23 63 views
0

我想在我的Mac上使用64位Python解釋器,所以我不得不從源碼重建。但是,使用我自己的自定義構建解釋器時,當我在shell中運行解釋器時嘗試導航時遇到了問題。鍵入蟒蛇到bash shell的結果在熟悉的:在Python終端中導航

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. 
>>> 

然而,當我嘗試用左箭頭和右箭頭導航,我得到奇怪的字符:

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 

這不會發生在蘋果的默認解釋器中。

這是什麼造成的?我該如何解決它?

回答

6

聽起來像您的自定義構建不包括readline。應該是一個簡單的配置更改和重建,檢查here欲知更多信息。

+1

謝謝。 顯然,Appled默認不包含GNU readline實用程序。它可以從 下載和安裝http://tiswww.case.edu/php/chet/readline/rltop.html – dzhelil 2009-10-23 23:18:19

0

here安裝GNU readline庫,並重建python修復了這個問題。