Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Lonami/autoit
Automate it with Python
https://github.com/Lonami/autoit
Last synced: 3 months ago
JSON representation
Automate it with Python
- Host: GitHub
- URL: https://github.com/Lonami/autoit
- Owner: Lonami
- Created: 2018-06-29T12:05:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-25T17:14:50.000Z (almost 2 years ago)
- Last Synced: 2024-07-05T00:31:18.378Z (4 months ago)
- Language: Python
- Homepage:
- Size: 69.3 KB
- Stars: 43
- Watchers: 2
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
ait
===Automate it with Python.
What is this?
-------------This Python 3 package aims to help you automate several GUI actions
easily through Python, like clicking, moving the mouse around, using
the keyboard, etc.How to install it?
------------------.. code-block::
pip install autoit
External requirements?
----------------------- Windows, or
- Linux- ``xdotool`` to do any ``ait`` operation.
- Python's ``Xlib`` to use ``ait.log`` (mouse/keyboard logger).What does it look like?
-----------------------.. code-block:: python
import ait
# Click wherever the mouse is
ait.click()# Click with the right mouse button
ait.click('R')# Click at some position
ait.click(140, 480)# Click in the center of the screen with the middle button
ait.click(0.5, 0.5, 'M')# Click 10 pixels below
ait.click(0j, 10j)# Movement (absolute, percentage and relative) can also be done
ait.move(140, 480)
ait.move(0.5, 0.5)
ait.move(60j, -9j)# Mouse position can also be retrieved
x, y = ait.mouse()# Pressing keys can also be done
ait.press('q', '!', '\n') # Exit vim
ait.press(*'\b' * 10) # 10 backspaces
# Writing things with the keyboard too
ait.write('Hello world!\n')