#encoding=utf-8 import pyautogui from PIL import ImageGrab print("将光标移到左上角0,0坐标点停止运行程序") while True: # 获取当前光标位置 x, y = pyautogui.position() px = ImageGrab.grab().load() color = px[x, y] print("x:%s y:%s color:%s" % (x,y,color))
标签:ImageGrab,python,px,color,坐标,print,import,屏幕 From: https://www.cnblogs.com/pu369/p/17164561.html