栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Python-pyautogui模块

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Python-pyautogui模块

1、安装pyautogui模块
C:Userslenovo>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) 
  
  
 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/221877.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号