Python 프롬프트 출력 순서가 잘못됨

Python 프롬프트 출력 순서가 잘못됨

내 Python 설치는 OS X 10.10.4의 Macports와 함께 제공됩니다. Macports를 사용하여 Python을 2.7.10으로 업데이트한 후 Python 셸은 이제 단일 명령문 출력 앞에 프롬프트 문자열 ">>>"를 출력합니다.

$ python
Python 2.7.10 (default, Aug 26 2015, 18:17:29)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print "test"
>>> test
print "foo"
>>> foo

Python 2.7.6이 설치된 Ubuntu VM에서는 동일한 명령문의 출력이 다음과 같습니다.

vagrant@vagrant-ubuntu-trusty-64:~$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "test"
test
>>> print "foo"
foo
>>>

순서가 잘못된 문제를 해결할 수 있는 방법이 있나요?

답변1

readline을 사용하여 Python 변형을 설치합니다. 나는 당신이 소스에서 빌드하고 있다고 가정합니다.

sudo port -v install python27 +readline

아직 수정되지 않은 libedit로 Python을 컴파일할 때 알려진 문제가 있습니다.

관련 정보