【问题标题】:Python 3 Win32 SendKeys {PrtSc} Not WorkingPython 3 Win32 SendKeys {PrtSc} 不工作
【发布时间】:2017-10-10 07:33:11
【问题描述】:

我正在尝试通过按“PRTSC”按钮来获取 Windows 中所有显示器的屏幕截图。我的代码需要尽可能精简,这是我想出的最好的解决方案,但是,它在 python 3 中不起作用,这是一个要求。我发送其他击键没有问题。有什么想法吗?

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}")

【问题讨论】:

    标签: python python-3.x screenshot win32com sendkeys


    【解决方案1】:

    检查:Get screenshot on Windows with Python? 或 Simulate the print screen key in python。 这些链接应该有助于使用“PrtSc”按钮截取屏幕截图

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-14
      • 2018-10-28
      • 2021-01-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多