I want to prompt the user for an input via command line. I can do this with
time = raw_input("Enter a time (hh:mm): ") # Python 2.x
or
time = input("Enter a time (hh:mm): ") # Python 3
However, I would like to give the user an editable template, i.e. the command line should read:
Enter a time (hh:mm): 08:00
and the 08:00 should be editable. Now the user can hit enter and '08:00' is returned or he can change it to:
Enter a time (hh:mm): 08:45
to return '08:45'. Is anything like this possible?
Further info:
I use Linux with Python 2.7 (but other solutions are fine as well)
The prompt and the editable text can also be on separate lines.
I know that this particular example could be solved otherwise ("return for 08:00") but of course this is not so easy for what I actually want to do.