How control a GUI for an unrelated application from a Python script?

Chris Angelico rosuav at gmail.com
Thu Jun 13 20:00:38 EDT 2019


On Fri, Jun 14, 2019 at 9:51 AM Christian Seberino <cseberino at gmail.com> wrote:
>
> I have a third party GUI that manages some hardware.
>
> I want to control the hardware from a Python script.
>
> This seems to mean I need to somehow have Python code
>   that imitates a human doing the necessary
>     actions on the GUI (selecting menu options, pressing buttons, etc.)
>
> Is this possible / easy / doable?
>

Possible? Yes. Easy? Probably not. So I would recommend first seeing
if there's any sort of command-line tool, or command-line invocation
for the GUI tool (some programs will open a GUI if given no arguments,
but you can provide args to make them do stuff straight away).

Once you've exhausted all options of easy automation, yes, you CAN
have a program manipulate a GUI. It's fiddly, though.

ChrisA



More information about the Python-list mailing list