I want to create an "interactive selection" in Python (not sure if I worded that correctly, look at the example below) that lets users press their up and down keys to choose an option and return to confirm it, then it continues with the script. An example output in a terminal would be something like this:
$ python script.py
Please select an option.
[ ] Option 1
[ ] Option 2
[*] Option 3
You have chosen: Option 3
After that first string had printed, the user could use their arrow keys to choose their option marked by the asterisk. The script would look somewhat like this:
print 'Please select an option.'
option = interactive_choice(['Option 1', 'Option 2', 'Option 3'])
print 'You have chosen: ' + option
Anyone know how to do this?