前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Python-pyautogui模块

Python-pyautogui模块

作者头像
py3study
发布2020-01-09 00:00:30
6660
发布2020-01-09 00:00:30
举报
文章被收录于专栏:python3

1、安装pyautogui模块 C:\Users\lenovo>pip install pyautogui Collecting pyautogui   Downloading PyAutoGUI-0.9.36.tar.gz (46kB)     100% |████████████████████████████████| 51kB 18kB/s Collecting pymsgbox (from pyautogui)   Downloading PyMsgBox-1.0.6.zip Collecting PyTweening>=1.0.1 (from pyautogui)   Downloading PyTweening-1.0.3.zip Collecting Pillow (from pyautogui)   Downloading Pillow-5.0.0-cp36-cp36m-win_amd64.whl (1.6MB)     100% |████████████████████████████████| 1.6MB 57kB/s Collecting pyscreeze (from pyautogui)   Downloading PyScreeze-0.1.14.tar.gz Installing collected packages: pymsgbox, PyTweening, Pillow, pyscreeze, pyautogui   Running setup.py install for pymsgbox ... done   Running setup.py install for PyTweening ... done   Running setup.py install for pyscreeze ... done   Running setup.py install for pyautogui ... done Successfully installed Pillow-5.0.0 PyTweening-1.0.3 pyautogui-0.9.36 pymsgbox-1.0.6 pyscreeze-0.1.14

2、eclipse + Pydev 使用pyautogui模块 按固定坐标移动鼠标 from pyautogui import moveTo for i in range(10):     moveTo(100,100,duration=0.25)     moveTo(200,100,duration=0.25)     moveTo(200,200,duration=0.25)     moveTo(100,200,duration=0.25) 移动当前鼠标 from pyautogui import moveRel for i in range(10):     moveRel(100,0,duration=0.25)     moveRel(0,100,duration=0.25)     moveRel(-100,0,duration=0.25)     moveRel(0,-100,duration=0.25) 获取当前鼠标位置 >>> import pyautogui >>> pyautogui.position() (673, 527) >>> pyautogui.position() (639, 654) >>> pyautogui.position() (1276, 745) 

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019/09/12 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档