【发布时间】: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