Listing processes with Python

Matthew Knepley knepley at mcs.anl.gov
Thu May 22 11:10:13 EDT 2003


       Is there a portable way to obtain a process list in Python?

I looked in the OS module first but saw nothing. I tried the PythonCookbook,
but the only relevant recipe (pykill) using os.system() to call 'ps' which
is totally non-portable even among unices. I ma not sure how portable the
/proc filesystem is.The purpose here is to implement something like killall.
I want to get rid of runaway server daemons.

   Thanks,

        Matt
-- 
"Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness




More information about the Python-list mailing list