[Tutor] capturing process's status with python

Alan Gauld alan.gauld at btinternet.com
Fri Aug 24 01:46:29 CEST 2007


"Flaper87" <flaper87 at gmail.com> wrote

> i would like to know how can i capture the system process's status 
> with
> python, i need to know if they are sleeping, zombie or runing.

The simplest route on Unix may be just to run ps using
the subprocess.Popen object or os.popen. You can then
parse the ps output.

The OS topic of my tutor gives some examples of running ps
using popen and Popen...

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld





More information about the Tutor mailing list