Robotic Process Automation

Can Python be used to automate Desktop GUI tasks and legacy software?

SU Asked by Susan Wilson · 20-06-2025
0 upvotes 11,488 views 0 comments
The question

I have an old accounting program that doesn't have an API or web interface. Is it possible to use Python to automate mouse clicks and keyboard inputs to enter data into this desktop application? I've looked into PyAutoGUI but I'm worried about the script breaking if a window moves slightly

3 answers

0
PA
Answered on 25-06-2025

PyAutoGUI is great for simple tasks, but for legacy Windows apps, you should check out Pywinauto. Unlike PyAutoGUI, which relies on screen coordinates, Pywinauto "talks" to the actual backend controls of the window. This means it can find a button by its name or ID, so it won't matter if the window is moved or resized. If the app is very old or "non-standard," you can use the image recognition feature in PyAutoGUI to locate icons on the screen, providing a hybrid approach to Robotic Process Automation.

0
RI
Answered on 28-06-2025

If you use image recognition, how do you handle different screen resolutions or "dark mode" settings that might change how those icons appear to the script?

JO 30-06-2025

That’s a common hurdle, Richard. The trick is using the confidence parameter in the locateOnScreen function. By setting it to around 0.8 or 0.9, you allow for slight pixel variations. Also, always try to use grayscale matching where possible. However, the real pro tip is to force the legacy application to open in a fixed resolution and standard theme before the automation starts to ensure consistent results every time.

0
DA
Answered on 02-07-2025

It’s basically building your own mini-RPA bot. Python is much more flexible for this than expensive enterprise software like UiPath for smaller, targeted tasks.

SU 03-07-2025

Totally, Daniel. I’ve saved my company thousands in licensing fees by just writing custom Python automation scripts for these simple back-office chores.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

World globe icon Country: India

Book Free Session