[python-win32] How to determine if a process (known pid)

Srivastava, Vaibhav (View Eng) vaibhav.s at vieweng.com
Tue Oct 7 19:13:12 CEST 2008


You can "try" using CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); and Process32First(snapshot, &process_entry);

I have had some success with this but sometimes this also could not recognize a running process. 

I am new to Python so am not sure if this available through python's windows API
----------------------------------------------------------------------

Message: 1
Date: Sun, 05 Oct 2008 02:24:28 +0200
From: Stef Mientki <stef.mientki at gmail.com>
Subject: [python-win32] How to determine if a process (known pid) is
	still	running ?
To: python-win32 at python.org
Message-ID: <48E8093C.40700 at gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

hello,

How to determine if a process (known pid) os still running ?

Googling the web, I found 1 solution in killing the process,
but that's not what I want, I want to reuse the running process.

I could also ask a complete list of active processes,
but from my experiences that's quite slow.

Any better solutions ?

thanks,
Stef Mientki





More information about the python-win32 mailing list