同步操作将从 Gitee 极速下载/pywinauto 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
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.
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.
Execute pip install -U pywinauto
Execute conda install -c conda-forge pywinauto
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.AboutNotepad.OK.click()
app.UntitledNotepad.Edit.type_keys("pywinauto Works!", with_spaces = True)
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")
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_Properties
Properties.print_control_identifiers()
Properties.Cancel.click()
Properties.wait_not('visible') # make sure the dialog is closed
pip install -U Pillow
) to be able to call capture_as_image()
method for making a control's snapshot.Run all the tests: python ./pywinauto/unittests/testall.py
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.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。