test.py 313 B

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