# -*- coding: utf-8 -*- import pyautogui # 获取屏幕分辨率 screen_width, screen_height = pyautogui.size() # 计算目标坐标(例如,屏幕宽度的20%和高度的30%) x = int(screen_width * 0.2) # 20% 的屏幕宽度 y = int(screen_height * 0.3) # 30% 的屏幕高度 pyautogui.moveTo(100, 100)