Possible Duplicate:
Show default value for editing on Python input possible?
I’d like to have a raw_input to ask for confirmation on something. Is there a way to have text already “entered” before the user types anything? For example:
>>> x = raw_input('1 = 2. Correct or incorrect? ', 'correct')
1 = 2. Correct or incorrect? correct
This could be compared to <imput type="text" value="correct"> in HTML. The text would be automatically typed for the user, but they could add to or erase all/part of it if they desire. Can this be done?
Example 1:
Test code:
Outputs:
Example 2:
Example 3 (more complex):
Usage:
Worked in Unix/Linux console (not from IDE)