0

Possible Duplicate:
raw_input in python without pressing enter

Some of the code:

print "Do you want to (e)ncode?"
option = raw_input("> ")
if option == "e":
    print "Encoding..." # and some other code, which isn't important here
else:
    pass

What I want to do is that if you enter "e", it immediately performs the code in the block, without pressing 'Enter'.

Is this possible? If yes, how?

4

0 回答 0