Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How come when I press the Up or Down Arrow keys in the Python interpreter I get ^[[A or ^[[B instead of history? [duplicate]

People also ask

What are the arrow keys in python?

K_UP , K_DOWN , K_LEFT , and K_RIGHT correspond to the arrow keys on the keyboard. If the dictionary entry for that key is True , then that key is down, and you move the player .

What is command line interpreter in python?

It means it executes the code line by line. Python provides a Python Shell, which is used to execute a single Python command and display the result. It is also known as REPL (Read, Evaluate, Print, Loop), where it reads the command, evaluates the command, prints the result, and loop it back to read the command again.


It looks as if you're using a build from source. It looks like you'll need to rebuild Python after installing the libreadline-dev or equivalent package on your distribution.

Update: There should be no special build steps needed, just running make should do. There are some messages printed at the end about optional modules which couldn't be built because of missing dependencies (in addition to readline, there are also Tcl/Tk, zlib, gdbm and openssl dependencies, for example).

If for some reason just running make doesn't work, try running configure again first (if make doesn't already run it for you).