2022年 11月 5日

python代码实现自动点击屏幕

安装需要的包:

pip install pymouse
  • 1

下载pyhook
http://www.lfd.uci.edu/~gohlke/pythonlibs/ pyhook下载链接

pip install pyhook文件路径
  • 1
pip install PyUserinput
  • 1

运行代码成功

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)位置左击
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

参考:https://blog.csdn.net/weixin_41561539/article/details/94294828