views:

250

answers:

3

The problem I have is that I have this Python script to launch a application. After the application is launched (the GUI is shown on screen), I want to make it de-activated. It can be done manually by activating another window, or minimizing this app, or pressing the Show Desktop key for WindowsXP.

So is there any way that I can do this by Python? Core or 3rd party library would be all ok.

Thanks!

+5  A: 

Take a look at SendKeys. It is in the pypi, so you can install it via easy_install.

DoR
SendKeys is a very thin wrapper around the W32 SendKeys interface so there is plenty of documentation out there - http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx is a good page if you want to send any special keycodes
Ravi
A: 

You can use pywin32 to send a minimize event.

Roger Pate
A: 

I've used AutoIt (via it's COM interface) a lot of times

lazy1