How do I interact with Windows programs

com, python, winapi

Solution

If the application supports COM, use COM using `win32com`. This tutorial helped me a lot. If it does not, you can use something like `pywinauto` or similar software. It is usually described as module for GUI testing. `SendKeys` comes handy for non-standard GUIs as a last resort.

Ranorex Spy is very helpful tool for identifying GUI elements.

Some of my colleagues also use compiled AutoHotkey scripts.

Problem

So I'm trying to create an automatic installer using Python. How would I go about interacting with native Windows applications that I launch? I am currently launching them using subprocess.call. Would I need to use Win32com? IronPython? Call a VB script from Python? I've been trying to look into COM objects, but all I see are default Microsoft applications.

Original source