Python Prompt Output Out of Order

3

My Python installation comes with Macports on OS X 10.10.4. After updating Python to 2.7.10 with Macports, the Python shell now outputs the prompt string ">>>" before the output of a single statement:

$ 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

While the same statements' output look like this on an Ubuntu VM with Python 2.7.6:

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

Is there any way to fix the out-of-order issue?

Shun Liang

Posted 2015-09-28T18:23:59.570

Reputation: 33

Answers

2

Install the python variant with readline. I'm assuming you are building from source then

sudo port -v install python27 +readline

There is a known issue with compiling python with libedit which hasn't been fixed yet.

fd0

Posted 2015-09-28T18:23:59.570

Reputation: 1 222