📜  如何在python代码示例中模拟按键

📅  最后修改于: 2022-03-11 14:45:28.838000             🧑  作者: Mango

代码示例1
# in command prompt, type "pip install pynput" to install pynput.
from pynput.keyboard import Key, Controller

keyboard = Controller()
key = "a"

keyboard.press(key)
keyboard.release(key)