import keyboard
abc = True
def run_func():
print('Hi, welcome!')
print('If you want to do this, press A or press B for doing that.')
while abc:
if keyboard.is_pressed('a'):
print('This function is run!')
abc = True
elif keyboard.is_pressed('b'):
print('That function is run!')
abc = True
print('To start press S')
while abc:
if keyboard.is_pressed('S'):
run_func()
abc = True
我不知道怎么按键,但我找到了答案:-
我们可以使用
keyboard
模块用法:当我们按键时,我们可以运行函数和许多东西
相关问题 更多 >
编程相关推荐