Python 3.5+ Arrow keys and others in the console

Vincent Vande Vyvre vincent.vande.vyvre at telenet.be
Sun Apr 16 04:56:15 EDT 2017


Hi,

I'm using Python 3.5 and 3.6 in venv and I see a strange behaviour in 
the interactive interpreter.

The arrow keys can't be used to move the cursor into the current line of 
code or to rewrite the last lines.

With the 3.5 I can use the backspace and erase the code but not in 3.6

Python 3.5.2 (default, Dec 19 2016, 11:46:33)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
 >>> f = "kjhfgt"^[[D            # Left Arrow Key
 >>> ^[[A                        # Up Arrow Key


Python 3.6.1 (default, Apr 12 2017, 11:39:17)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
 >>> f = "lkjgh"
 >>> ^[[A^[[B                    # Up Arrow Key and Backspace Key
   File "<stdin>", line 1

     ^
SyntaxError: invalid syntax
 >>>


Am I the only one with this ?

Vincent




More information about the Python-list mailing list