显示鼠标位置,移动鼠标

#先下载pyautogui库,pip install pyautogui
import os,time
import pyautogui

print(pyautogui.size()) # 返回所用显示器的分辨率; 输出:Size(width=1920, height=1080)
width,height = pyautogui.size()
print(width,height) # 1920 1080
print(pyautogui.position())
pyautogui.moveTo(100,300,duration=1)
print(pyautogui.position())

posted @ 2022-04-11 19:06  paoPaoLong_liu  阅读(42)  评论(0)    收藏  举报