interacting with gui-based programs

Dave googlegroups at thuswise.com
Thu Feb 20 07:45:00 EST 2003


Simon Brunning <SBrunning at trisystems.co.uk> wrote in message news:<mailman.1045649995.30290.python-list at python.org>...
> > From:	bronzesink77 at hotmail.com [SMTP:bronzesink77 at hotmail.com]
> > Thanks for the reply. I must say, I'm surprised that the only way to
> > interact with the GUI of Mozilla and Kazaa running on Linux is using a
> > closed-source program (AutoIt). Do langauges other than Python have
> > modules that could be compiled and used with Python to interact with
> > these GUIs? What language could AutoIt be written in that is more
> > capable than Python?

I've had some success using Expect (which is based on TCL). It redirects
the tty of a shell session, both in and out, so that keystrokes from the
user may be scripted, and output parsed and analysed. In other words, to
script an interactive session.

If the GUI app is well equipped with shortcut keystrokes to menu items,
maybe this would in these cases too?. The advantage of going through the user
interface of the app is that it would work across platforms.

The good news is that there are a couple of Python implementations of
Expect. One (the one I happen to prefer) is pure Python, and the other
is a wrapper around the original. Do a Google for pyExpect or expectpy.
I can't remember which is which off the top of my head.

Hope this helps,

                Dave.




More information about the Python-list mailing list