【发布时间】:2014-04-16 10:34:31
【问题描述】:
我在谷歌上搜索了很多,但我什么也没得到。 我们可以在 python 中模拟打印屏幕键吗? 如果是,那么如何在python中模拟打印屏幕键?
【问题讨论】:
-
这能回答你的问题吗? python auto save printscreen
标签: python python-2.7 simulate printscreen
我在谷歌上搜索了很多,但我什么也没得到。 我们可以在 python 中模拟打印屏幕键吗? 如果是,那么如何在python中模拟打印屏幕键?
【问题讨论】:
标签: python python-2.7 simulate printscreen
要截取屏幕截图,您获得的 cmets 将起作用:
Get screenshot on Windows with Python? python auto save printscreen
要模拟打印屏幕键,您可以使用击键自动化库,我可以证明其中两个可用于此目的:
它使用SendKeys 到simulate keystrokes (or see reference here)。
它使用standalone sikuli API 来处理击键等等。然后是 list of keys you can simulate,通过将各自的 unicode char 传递给 sikuli 方法 type()
【讨论】:
您可以使用pyautogui 库:
#pip install pyautogui
from pyautogui import press
press("printscreen")
【讨论】: