一个简单的跨平台 GUI 自动化模块,用于 Python 和 Rust。
AutoPy 简介和教程 ========================================
$ pip install -U autopy 如果失败,请安装 rustup,然后运行: $ rustup default nightly-2019-10-05 $ pip install -U setuptools-Rust $ pip install -U autopy 另一个选项是从 GitHub 仓库中构建最新的源代码: $ git clone git://GitHub.com/autopilot-rs/autopy-rs.git $ cd autopy $ Python -m venv .env && source .env/bin/activate $ maturin develop Windows 上从源代码安装的其他可能过时的说明可在 这里 找到。 ### Hello World
import autopy
def hello_world():
autopy.alert.alert("Hello, world")
hello_world()AutoPy 包含了许多用于控制鼠标的函数。如需完整的 请参阅 [API] 列表。 参考](https://www.autopy.org/documentation/api-reference/mouse.html)。例如, 立即将鼠标"传送"到屏幕的左上角:
导入 autopy autopy.mouse.move(0, 0) 为了让鼠标移动更加真实,我们可以使用: 导入 autopy autopy.mouse.smooth_move(0, 0) 更棒的是,我们可以编写自己的函数,让鼠标在屏幕上移动。 作为正弦波:
import autopy
import math
导入时间
import random
import sys
T暂无开放 Issues,或尚未同步最近议题。