Skip to main content

PyLinuxAuto

PyLinuxAuto

Linux GUI Automation with Python.

Python Linux

PyPI Downloads

PyLinuxAuto 是一个用于 Linux 桌面 GUI 自动化测试的 Python 模块,支持多种元素定位方法和键鼠操作。

文档:https://youqu.uniontech.com/

安装

pip3 install pylinuxauto

使用说明

键鼠控制

import pylinuxauto

pylinuxauto.click()
pylinuxauto.double_click()

使用 Accessibility 操作元素

通过 Accessibility 路径查找并操作元素,路径名称可以通过 sniff 命令查看。

import pylinuxauto

pylinuxauto.find_element_by_attr_path("/dde-doc/Btn_文件管理器").click()

使用图像识别操作元素

传入一张目标图片的路径,自动在当前屏幕中查找目标图片。

import pylinuxauto
from pylinuxauto.config import config

config.IMAGE_SERVER_IP = "192.168.0.1"
pylinuxauto.find_element_by_image("~/Desktop/template.png").click()

使用 OCR 操作元素

使用传入需要识别的文本字符,使用 OCR 在当前屏幕中识别。

import pylinuxauto
from pylinuxauto.config import config

config.OCR_SERVER_IP = "192.168.0.1"
pylinuxauto.find_element_by_ocr("中国").click()

使用 UI 相对位移操作元素

通过将目标按钮相对于应用窗口的位置信息,然后动态获取应用窗口在当前屏幕中的信息,最后计算出目标按钮在当前屏幕中的位置。

import pylinuxauto
from pylinuxauto import Ele, Ref

close_btn = Ele(xy=(25, 25), ref=Ref.RIGHT_TOP, appname="dde-file-manager", alias="关闭按钮")

pylinuxauto.find_element_by_ref(close_btn).click()
pylinuxauto.find_element_by_ref(close_btn).right_click()

开源许可证

PyLinuxAuto 在 GPL-2.0 下发布。

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python3_pyatspi-1.19.0.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python3_pyatspi-1.19.0-py3-none-any.whl (61.0 kB view details)

Uploaded Python 3

File details

Details for the file python3_pyatspi-1.19.0.tar.gz.

File metadata

  • Download URL: python3_pyatspi-1.19.0.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.3

File hashes

Hashes for python3_pyatspi-1.19.0.tar.gz
Algorithm Hash digest
SHA256 c6f2d8ccded46b25c161a42b106053d33c0e23da53a63f346aec4a97e6e5aafd
MD5 402a6d0c2b627943ff0a3b302f50dbc3
BLAKE2b-256 32cba6d6e8f82f473fe566f73cf2bff926f938b3513aa524767cf68dbf5e718d

See more details on using hashes here.

File details

Details for the file python3_pyatspi-1.19.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python3_pyatspi-1.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc0d5436bf925199c28f421279dc3e428a2aeba92bcb4d8e63013eb01b205dfc
MD5 660bedfbc0ed54a6f1e9c37e0aea9982
BLAKE2b-256 3565cf75a82416ac41c966d8da4c742db1a04f9eacd2b858116d6bb73cac266d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.19.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page