python模拟鼠标点击教程
python模拟鼠标点击教程
pip install python-xlib (安装pymouse必须要xlib的支持)
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pymouse
安装成功有suceess install pymouse
如果提示Requirement already satisfied: pymouse 那就去插件库删掉 PyMouse-1.0-py3.8.egg-info和pymouse 然后重新装
我用了国内镜像安装 速度快
安装了以上模块 然后运行下面代码
from pymouse import PyMouse m = PyMouse() a = m.position() #获取当前坐标的位置 print(a) m.move(50, 500) #鼠标移动到(x,y)位置 a = m.position() print(a) m.click(50, 50) #移动并且在(x,y)位置左击 m.click(300, 300, 2) #(300,300)位置右击
相关推荐
huavhuahua 2020-11-20
weiiron 2020-11-16
cakecc00 2020-11-15
千锋 2020-11-15
JakobHu 2020-11-14
guangcheng 2020-11-13
xirongxudlut 2020-11-10
solarLan 2020-11-09
pythonxuexi 2020-11-08
文山羊 2020-11-07
susmote 2020-11-07
wuShiJingZuo 2020-11-05
Pythonjeff远 2020-11-06
jacktangj 2020-11-04
lousir 2020-11-04
Noneyes 2020-11-10
ailxxiaoli 2020-11-16
chensen 2020-11-14
Nostalgiachild 2020-11-13