【发布时间】:2020-03-22 10:01:39
【问题描述】:
只有黑屏,怎么回事?
import msvcrt
while(1):
choice = msvcrt.getch()
if(choice =='a'):
print('a')
elif(choice =='s'):
print('s')
【问题讨论】:
-
我想在不按回车的情况下从用户那里获取单个字符输入
-
啊,这不是shebang问题吧?
-
@Aiyion.Prime Windows 不知道 shebangs
-
@Aiyion.Prime 您提供的参考资料是一本关于 Python 2 的书。
标签: python python-3.x msvcrt