How can I allow the arrows in raw_input()
?
There is a better way?
When I write and I use the left arrow, ^[[D
appears.
I am using Linux.
How can I allow the arrows in raw_input()
?
There is a better way?
When I write and I use the left arrow, ^[[D
appears.
I am using Linux.
If you are Windows, the cursor keys work normally to allow editing of your input. On Linux, I find that I need to import readline
to get the input editing module.
If you Google for "python readline" you will get many more hits and suggestions on enhanced editing, tab completion, etc.
Have you tried?
myinput = raw_input("Enter your input ->")
I am using windows , it works fine. Don't have a linux to simulate.
Also, why are you pressing arrow keys? Is it a need for program?
You can simply make arrow using a dash
and greater than
keys.