Python 3 Win32 SendKeys{PrtSc}不工作
我试图通过按下“PRTSC”按钮来抓取Windows中所有监视器的屏幕截图。我的代码需要尽可能精简,这是我提出的最好的解决方案,但是,它在Python3中不起作用,这是一个要求。我没有问题发送其他按键。有什么想法吗Python 3 Win32 SendKeys{PrtSc}不工作,python,python-3.x,screenshot,win32com,sendkeys,Python,Python 3.x,Screenshot,Win32com,Sendkeys,我试图通过按下“PRTSC”按钮来抓取Windows中所有监视器的屏幕截图。我的代码需要尽可能精简,这是我提出的最好的解决方案,但是,它在Python3中不起作用,这是一个要求。我没有问题发送其他按键。有什么想法吗 import win32com.client class SendKeys: def __init__ (self): self.win = win32com.client.Dispatch("WScript.Shell") def send (se
import win32com.client
class SendKeys:
def __init__ (self):
self.win = win32com.client.Dispatch("WScript.Shell")
def send (self, data):
self.win.SendKeys(data, 0)
sk = SendKeys()
sk.send("{PrtSc}")
支票:或。
这些链接有助于使用“PrtSc”按钮截图