WIN32: How to control another windows application

Alex Martelli aleaxit at yahoo.com
Thu Jun 28 11:32:27 EDT 2001


"Thomas Volkmar Worm" <worm at gdp-group.com> wrote in message
news:3B3B45C3.59825716 at gdp-group.com...
> Hi,
>
> I want to control another application from a python script by sending
> key events and mouseclicks to it. The script should do what I normally
> do when I work with this application interactively. Is this possible and
> how do I do this. Does anybody has example scripts or can give me some
> hints where I can find further information?

It's a very fragile approach (you're *WAY* better off using the
Automation interface of the other application -- just about every
application on Windows exposes some object model via Automation),
but if you have some legacy app and absolutely must control it
that way, see for example:

http://aspn.activestate.com/ASPN/Python/Cookbook/Recipe/65107


Alex






More information about the Python-list mailing list