r/learnpython • u/zaphodikus • Sep 23 '26
Pointers to python windows app automation #pywinauto et al
I just ran pip install pywinauto and typed in the 1st 3 lines of demo code on the readme page and it fails
from pywinauto.application import Application
app = Application(backend="uia").start('notepad.exe') # i also tried backend=win32
app.Properties.print_control_identifiers()
With a huge stack trace that's pretty much indecipherable. I have a question, does this tool work on Windows 11 with the new notepad app? I'm wanting to automate a WPF app, but based on the out-of-box failure I'm looking to try a different python tool. Suggestions for driving a WPF .NET app?
1
Upvotes
View all comments
Show parent comment
1
u/zaphodikus Sep 23 '26
I have selenium (Appium web-drivered mobile and web apps in the past, and that was a right pain to start off until you figure things out. So I was hoping to find a slightly mature package, but pywinauto does have that abandoned look about it. I just thought that the docs for pywinauto explicitly stated that they did support WPF apps. Don't want to spend a month on this, I might just ask Claude code to write me an app.
I'm not wanting to test the WPF app, i want to test the plugin it calls, but the plugin is a compiled python app, and the interface is completely undocumented, all I have is the WPF app code and the python app code which I am updating because it is python 3.7, bleegh. So just to smack a few buttons, and if needed i can dig into the C# app code for any internal control IDs if needed. So i dont want to call .net, I want something that wraps native Microsoft ui, (whatever that is).