Default/editable string to raw_input

Paraic Gallagher paraic.gallagher at gmail.com
Wed Mar 22 05:22:48 EST 2006


Hi,

This is my first post to the list, I hope somebody can help me with this 
problem. Apologies if it has been posted before but I have been internet 
searching to no avail.

What I am trying to do is provide a simple method for a user to change a 
config file, for a test suite.
The config file consists of a number of keys, eg. build number, target 
device, etc.

What I would like to do is give the user a key, and the previous value 
for that key.
The user can then accept the previous value or edit it on the line.

I have a method where the previous value of a key is presented to the 
user and can be accepted if the user hits return. But as some of the 
values are somewhat long, and the user may only need to change 1 or 2 
characters, it would be a nice feature to offer line editing.

I can get the readline.set_pre_input_hook() function to send text after 
a raw_input prompt, but this text cannot be edited.

Thanks in advance for any help.
Paraic.



More information about the Python-list mailing list