Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I interact with Windows programs

Tags:

python

com

winapi

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.

like image 386
Steven Matthews Avatar asked Apr 25 '12 19:04

Steven Matthews


People also ask

How do I access programs in Windows 11?

Click on the Start button and click the cog on the left-hand side of the menu to open the Settings. Click the Apps tab along the left side of its window.

How do I fix incompatible programs in Windows 10?

In the search box on the taskbar, type the name of the program or app you want to troubleshoot. Select and hold (or right-click) it, and then select Open file location. Select and hold (or right-click) the program file, select Properties, and then select the Compatibility tab. Select Run compatibility troubleshooter.


1 Answers

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.

like image 181
Fenikso Avatar answered Oct 29 '22 15:10

Fenikso