所以我最近一直在玩Getch。所以,让我们说我们做这样的事情......
from msvcrt import getch
while True:
key = ord(getch())
if key == 27: #ESC
print ("Value Read")
break
elif key == 13: #Enter
select()
elif key == 224: #Special keys (arrows, f keys, ins, del, etc.)
key = ord(getch())
if key == 80: #Down arrow
moveDown()
elif key == 72: #Up arrow
moveUp()
我想要做的是让Python控制台读取输入,这样我就不必将Python控制台作为我的活动窗口。是否有人知道如何做到这一点,因为它看起来像" getch"只是在控制台中查找输入(这不是我想要的,我不确定这是否可以在Python中使用)。
感谢您的时间和考虑,
mmacheerpuppy
答案 0 :(得分:0)