Python-Eingabeaufforderung außerhalb der Reihenfolge

307
Shun Liang

Meine Python-Installation wird mit Macports unter OS X 10.10.4 geliefert. Nach der Aktualisierung von Python auf 2.7.10 mit Macports gibt die Python-Shell jetzt die Eingabeaufforderung ">>>" vor der Ausgabe einer einzelnen Anweisung aus:

$ 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 

Während die Ausgabe derselben Anweisungen auf einer Ubuntu-VM mit Python 2.7.6 folgendermaßen aussieht:

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

Gibt es eine Möglichkeit, das Out-of-Order-Problem zu beheben?

3

1 Antwort auf die Frage

2
fd0

Installieren Sie die Python-Variante mit readline. Ich gehe davon aus, dass Sie von der Quelle aus bauen

sudo port -v install python27 +readline 

Es gibt ein bekanntes Problem beim Kompilieren von Python mit libedit, das noch nicht behoben wurde.