Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Windows GUI Automation with Python (based on text properties)

License

NotificationsYou must be signed in to change notification settings

pywinauto/pywinauto

Repository files navigation

DonateJoin the chat at https://gitter.im/pywinauto/pywinautoDocumentation StatusWindows TestsLinux Testscodecov.ioCode HealthCodacy BadgeCode Quality: PythonTotal Alerts

pywinauto

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 windowsdialogs 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 modulesmouse andkeyboard work on both Windows and Linux.

Enjoying this?

Just star the repo or make a donation.

paypal

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

  • In general the librarytends 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 inthe issues.

Setup

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

Documentation / Help

Simple Example

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

frompywinauto.applicationimportApplicationapp=Application().start("notepad.exe")app.UntitledNotepad.menu_select("Help->About Notepad")app.AboutNotepad.OK.click()app.UntitledNotepad.Edit.type_keys("pywinauto Works!",with_spaces=True)

MS UI Automation Example

More detailed example forexplorer.exe:

frompywinautoimportDesktop,ApplicationApplication().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")app.ProgramFiles.set_focus()common_files=app.ProgramFiles.ItemsView.get_item('Common Files')common_files.right_click_input()app.ContextMenu.Properties.invoke()# this dialog is open in another process (Desktop object doesn't rely on any process id)Properties=Desktop(backend='uia').Common_Files_PropertiesProperties.print_control_identifiers()Properties.Cancel.click()Properties.wait_not('visible')# make sure the dialog is closed

Dependencies (if install manually)

Packages required for running unit tests

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

Contribution

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

Copyrights

Pywinauto for native Windows GUI was initially written byMark 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)

[8]ページ先頭

©2009-2025 Movatter.jp