Python 3.10 windows10 中 截屏操作 使用 PyAutoGui


截屏,全屏


import pyautogui

im = pyautogui.screenshot('D:/test/a.png')

截屏,设置坐标及宽高


import pyautogui

im = pyautogui.screenshot('D:/test/a.png', region=(300, 300, 400, 400))