标签: python
可能重复: raw_input in python without pressing enter
部分代码:
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
我想要做的是,如果输入“e”,它会立即执行块中的代码,而不按“Enter”。
这可能吗?如果是,怎么样?