import pyautogui# 获取当前屏幕分辨率screen_width screen_height = pyautoguisizeprint当前屏幕分辨率:xformatscreen_width screen_height# 将屏幕分辨率设置为1920x1080pyautoguisize1920 1080# 切回之前的屏幕分辨率pyautoguisizescreen_width scree
import pyautogui
获取当前屏幕分辨率
screen_width, screen_height = pyautogui.size() print("当前屏幕分辨率:{}x{}".format(screen_width, screen_height))
将屏幕分辨率设置为1920x1080
pyautogui.size(width=1920, height=1080)
切回之前的屏幕分辨率
pyautogui.size(width=screen_width, height=screen_height)
原文地址: http://www.cveoy.top/t/topic/iYAX 著作权归作者所有。请勿转载和采集!