pyautogui效率慢优化
程序员文章站
2022-07-13 09:08:25
...
pyautogui为了安全的,有一个默认延迟时间0.1s,我们可以对其进行修改来改善效率:
# -*- coding: UTF-8 -*-
from ctypes import windll
import time
import pyautogui
pyautogui.PAUSE = 0.005
print(time.time())
for i in range(20):
windll.user32.SetCursorPos(900, 300)
pyautogui.click()
windll.user32.SetCursorPos(900, 200)
pyautogui.click()
print(time.time())