# -*- 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()
标签:pyautogui,截图,img,location,file,屏幕,识别 From: https://www.cnblogs.com/zhaoyiguang/p/16749820.html