pip install pymouse
下载pyhook
http://www.lfd.uci.edu/~gohlke/pythonlibs/ pyhook下载链接
pip install pyhook文件路径
pip install PyUserinput
运行代码成功
from pymouse import PyMouse
m = PyMouse()
a = m.position() #获取当前坐标的位置
print(a)
m.move(31, 223) #鼠标移动到(x,y)位置
a = m.position()
print(a)
m.click(31, 223) #移动并且在(x,y)位置左击
参考:https://blog.csdn.net/weixin_41561539/article/details/94294828