【问题标题】:Using pyautogui to unlock screen使用pyautogui解锁屏幕
【发布时间】:2018-12-13 00:56:19
【问题描述】:

我正在使用pyautogui 在 Windows 10 上解锁我的电脑屏幕。这是脚本:

pyautogui.FAILSAFE = False
time.sleep(7)
print("Pressing 'space'")
pyautogui.press('space')
print("Waiting for 3 seconds.")
time.sleep(3)
print("Typying Password")
pyautogui.press('p')
time.sleep(0.1)
pyautogui.press('a')
time.sleep(0.1)
pyautogui.press('s')
time.sleep(0.1)
pyautogui.press('s')
time.sleep(0.1)
pyautogui.press('w')
time.sleep(0.1)
pyautogui.press('o')
time.sleep(0.1)
pyautogui.press('r')
time.sleep(0.1)
pyautogui.press('d)
print("Hitting 'enter'")
pyautogui.press('enter')
time.sleep(9)

该脚本确实模拟了空格键,因为我的锁定屏幕被切换到它要求输入密码但它没有输入我的密码的屏幕。我想知道为什么?当我手动打开我的帐户时,脚本的输出确认它运行成功。可能是什么原因造成的?

【问题讨论】:

    标签: python-3.x windows-10 pyautogui


    【解决方案1】:

    不幸的是,作为安全预防措施,Windows 专门阻止自动脚本在计算机被锁定时运行,因此您将无法将任何键盘按下发送到登录屏幕。

    类似的情况也适用于,例如,防止模拟鼠标点击或键盘按下其窗口的 AV 软件。这可以防止恶意软件禁用 AV 软件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多