Windows GUI Automation with Python
Clone or download
vasily-v-ryabov Merge pull request #589 from vasily-v-ryabov/dont_use_deprecated_methods
Remote Execution Guide + more docs on global timings
Latest commit ca0d2ee Nov 10, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
apps Names correction Nov 11, 2017
ci Disable admin tests if the whole suite is running as Administrator. Jun 5, 2018
docs Finish attempts to highlight hyperlinks. Nov 4, 2018
examples Add global timings description to the docs, make more PEP8… Oct 28, 2018
pywinauto Merge pull request #589 from vasily-v-ryabov/dont_use_deprecated_methods Nov 10, 2018
sandbox Fix the rest of aliases usage. Oct 22, 2016
.checkignore Fix .checkignore settings Nov 1, 2015
.gitignore Updated doc for pywinauto.application.Wait/WaitNot. Sep 5, 2015
.landscape.yml Update credits page, fix major warnings. Sep 4, 2016
.travis.yml Fix coverage reporting on Linux. Apr 8, 2018
LICENSE Fix year in copyrights, add link to the Getting Started Guide. Jul 3, 2017 Minor update in Oct 31, 2016
MakeBackup.bat Merge branch 'pywinauto64master' May 25, 2015 Add code quality badges Sep 5, 2018
Readme.txt Improve local readme.txt. Jul 3, 2017
appveyor.yml Use psexec to restrict Python process rights. Jun 3, 2018
codecov.yml Tune some settings. Oct 30, 2016
dev-requirements.txt Update Pillow to support Py3.7 in tests. Jul 24, 2018
makedocs.bat Update makedocs.bat (fix #408). Sep 10, 2017
requirements.txt Update requirements.txt Apr 14, 2016
setup.cfg Fix #324 (wrong characters). Mar 1, 2017 Change project status to production/stable. Apr 7, 2018

Donate Join the chat at Documentation Status Windows Tests Linux Tests Code Health Codacy Badge Code Quality: Python Total Alerts


pywinauto is a set of python modules to automate the Microsoft Windows GUI. At its simplest it allows you to send mouse and keyboard actions to windows dialogs and controls, but it has support for more complex actions like getting text data.

Supported technologies under the hood: Win32 API (backend="win32"; used by default), MS UI Automation (backend="uia"). User input emulation modules mouse and keyboard work on both Windows and Linux.

Enjoying this?

Just star the repo or make a donation.


Your help is valuable since this is a hobby project for all of us: we do new features development during out-of-office hours.

  • In general the library tends to be cross-platform in the near future (Linux in 2018, macOS in 2019).
  • Reliable text based "record-replay" generator is also a high priority feature under development.
  • More feature requests and discusions are welcome in the issues.


  • run pip install -U pywinauto (dependencies will be installed automatically)

Documentation / Help

Simple Example

It is simple and the resulting scripts are very readable. How simple?

from pywinauto.application import Application
app = Application().start("notepad.exe")

app.UntitledNotepad.menu_select("Help->About Notepad")
app.UntitledNotepad.Edit.type_keys("pywinauto Works!", with_spaces = True)

MS UI Automation Example

More detailed example for explorer.exe:

from pywinauto import Desktop, Application

Application().start('explorer.exe "C:\\Program Files"')

# connect to another process spawned by explorer.exe
# Note: make sure the script is running as Administrator!
app = Application(backend="uia").connect(path="explorer.exe", title="Program Files")

common_files = app.ProgramFiles.ItemsView.get_item('Common Files')

# this dialog is open in another process (Desktop object doesn't rely on any process id)
Properties = Desktop(backend='uia').Common_Files_Properties
Properties.wait_not('visible') # make sure the dialog is closed

Dependencies (if install manually)

  • Windows:
  • Linux:
  • Optional packages:
    • Install Pillow (by pip install -U Pillow) to be able to call capture_as_image() method for making a control's snapshot.

Packages required for running unit tests

Run all the tests: python ./pywinauto/unittests/


Pull requests are very welcome. Read Contribution Guide for more details about unit tests, coding conventions, etc.


Pywinauto for native Windows GUI was initially written by Mark Mc Mahon. Mark brought many great ideas into the life using power of Python. Further contributors are inspired of the nice API so that the development continues.

Starting from 0.6.0 pywinauto is distributed under the BSD 3-clause license. Pywinauto 0.5.4 and before was distributed under the LGPL v2.1 or later.

  • (c) The Open Source Community, 2015-2018 (0.6.0+ development)
  • (c) Intel Corporation, 2015 (0.5.x maintenance)
  • (c) Michael Herrmann, 2012-2013 (0.4.2)
  • (c) Mark Mc Mahon, 2006-2010 (0.4.0 and before)