屏幕截图与定位识别
# -*- coding: utf-8 -*- import pyautogui import os file_url = os.getcwd() + '/file/img.png' # 屏幕截图 def demo1(): pyautogui.screenshot(region=(0, 0, 1920, 1080), imageFilename=file_url) # 定位识别 def demo2(): location = pyautogui.locateOnScreen(r'file/img.png') print(pyautogui.center(location)) demo1() demo2()
不求最好,但求更好!态度决定一切!