Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Finding out what other tasks are running

0 views
Skip to first unread message

Jeremy C B Nicoll

unread,
Nov 23, 2007, 8:25:59 AM11/23/07
to
Is there a cross-platform of determining what other processes (or in Windows
terms, other applications) are running?

Is it possible in a cross-platform way to ask some other application to shut
down, wait a while, and then test to see if it did shut?

Failing that are there separate Windows, Mac and Linux/Unix ways of doing
this?

--
Jeremy C B Nicoll - my opinions are my own.

Tim Golden

unread,
Nov 23, 2007, 8:37:40 AM11/23/07
to pytho...@python.org
Jeremy C B Nicoll wrote:
> Is there a cross-platform of determining what other processes (or in Windows
> terms, other applications) are running?
>
> Is it possible in a cross-platform way to ask some other application to shut
> down, wait a while, and then test to see if it did shut?
>
> Failing that are there separate Windows, Mac and Linux/Unix ways of doing
> this?

Sorry, thought I'd part-answered this a while back; doesn't seem
to have shown up. In short, I don't believe there's anything
truly x-platform. On Windows, one approach is WMI. Here's an
example:

http://tgolden.sc.sabren.com/python/wmi_cookbook.html#running_processes

There are other techniques, such as querying the top-level
windows or using the performance objects from the pywin32
modules.

TJG

Tim Golden

unread,
Nov 23, 2007, 8:40:53 AM11/23/07
to pytho...@python.org
Jeremy C B Nicoll wrote:
> Is there a cross-platform of determining what other processes (or in
Windows
> terms, other applications) are running?
>
> Is it possible in a cross-platform way to ask some other application
to shut
> down, wait a while, and then test to see if it did shut?
>
> Failing that are there separate Windows, Mac and Linux/Unix ways of doing
> this?
>

Ah. Just realised: you're the chap who asked on the PyUK list.
Didn't really give a detailed answer there, did I? Sorry. For
*nix, have a look at Chris Miles' PSI. (Another Londoner like me).

http://www.psychofx.com/psi/trac/wiki/

TJG

Tim Golden

unread,
Nov 23, 2007, 8:58:29 AM11/23/07
to pytho...@python.org
Tim Golden wrote:
> Jeremy C B Nicoll wrote:
>> Is there a cross-platform of determining what other processes (or in Windows
>> terms, other applications) are running?
>>
>> Is it possible in a cross-platform way to ask some other application to shut
>> down, wait a while, and then test to see if it did shut?
>>
>> Failing that are there separate Windows, Mac and Linux/Unix ways of doing
>> this?
>
> Sorry, thought I'd part-answered this a while back; doesn't seem
> to have shown up. In short, I don't believe there's anything
> truly x-platform...

... or I could eat my words and point you towards Christian Heimes
enumprocess package:

http://cheeseshop.python.org/pypi/enumprocess

TJG

0 new messages