python 模拟点击电脑上的图片按钮(他只能截屏查找按钮图片)
#!/usr/bin/python # -*- coding: UTF-8 -*- import time import pyautogui # while 1: # time.sleep(30); #定义单击事件 def mouseClick(image): x,y=pyautogui.locateCenterOnScreen(image) pyautogui.click(x,y,clicks=1,interval=0.2,duration=0.2,button='left') mouseClick(image='12.png')