Pre-initializing the input to raw_input() in Python?

Status
Not open for further replies.

nl

Ars Scholae Palatinae
1,018
For an application, I need to allow the user to interactively correct the value of a string, eg:

current_string = "something"
corrected_string = raw_input("Enter new value for %s> " % current_string)

raw_input supports the readline interface, allowing bash-style editing of the string as you are typing. I would like to initialize the string that the user edits with the value of current_string, so that they don't have to type the entire thing over again to fix a one-character typo, for instance.

Does anyone have a pointer to a module that provides this kind of functionality?

Thanks.
nl
 
Status
Not open for further replies.