In linux, the arrow keys don't work when I try to enter data for an input() function. I get escape characters. See below (when I pressed left arrow key).
dp@hp:~$ python3 -c "x = input('enter a number '); print(x)"
enter a number 123^[[D^[[D
I have readline installed (I am able to import it in the python shell).
The arrow keys work fine in the interactive interpreter but not in the above case (or when I execute input() from a script).
What could be the reason?
sys.argv[1:]) instead of usinginput()interactively.