小编vli*_*ana的帖子

Python 键盘模块在没有 root 的情况下无法工作

目前,我已经编写了一个语音助手的代码,可以用用户的语音进行书写。我使用 pip 中的 python 键盘模块。但是当我执行代码时,它告诉我没有root就无法写入。

代码如下,

elif (t.find("type") != -1):

    le = t.find("type") + len("type") + 1
    t = t[le:]
    try:
        print("Typing> ", t)
        keyboard.write('' + t+". ")
    except:
        print("Can't Type")
Run Code Online (Sandbox Code Playgroud)

python keyboard

8
推荐指数
1
解决办法
7774
查看次数

标签 统计

keyboard ×1

python ×1