significance
significance

Reputation: 5105

is there any simple way to make the python raw_input UI more like the bash UI?

i am using raw_input() in a script to take a user input which needs to refined iteratively.

is there any way simple way to give it the familiar cursor functionality enabling cursor and (ideally) mouse support so that the left and right cursors scroll along the string and the up cursor brings up the previous entry?

thanks :)

Upvotes: 0

Views: 513

Answers (2)

knifenomad
knifenomad

Reputation: 21

you can benefit from bash-like history-list editing by wrapping cmd module.

http://docs.python.org/library/cmd.html

Upvotes: 0

Alan Haggai Alavi
Alan Haggai Alavi

Reputation: 74292

You could make use of the readline module.

Upvotes: 2

Related Questions