【问题标题】:why do i get this error message when i'm just trying to detect a keypress?当我只是试图检测按键时,为什么会收到此错误消息?
【发布时间】:2021-10-18 14:25:49
【问题描述】:
import keyboard

if keyboard.is_pressed('a'):
    print('key pressed')
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 954, in _bootstrap_inner

【问题讨论】:

  • 其余的回溯在哪里

标签: python python-3.x keyboard


【解决方案1】:

根据你有限的信息,问题出在线程,而不是键盘,所以请检查完整的回溯,看看这个线程有什么问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-03
    • 2015-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-14
    相关资源
    最近更新 更多