用Python控制鼠标如何控制Python中的鼠标光标,即在Windows下将鼠标移动到特定位置并单击?
3 回答

紫衣仙女
TA贡献1839条经验 获得超15个赞
import win32api, win32condef click(x,y): win32api.SetCursorPos((x,y)) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)click(10,10)
添加回答
举报
0/150
提交
取消