【发布时间】:2013-04-22 11:01:38
【问题描述】:
例如我想要这样,
x = int(input("Please enter your guess :")
If x = 1:
Print ("correct")
虽然每次我需要按回车键,我怎样才能让它在按键时读取。
我确实找到了 getch(),虽然我无法让它工作。
【问题讨论】:
-
我确实看过了,尽管我希望有人可以为我提供一个如何使用 getch() 作为我的示例的示例。
-
code.activestate.com/recipes/134892 - 在 Windows 和 Unix 上从标准输入读取类似 getch() 的无缓冲字符(Python 配方)
标签: python python-3.x