Re: Processes in Linux from Python

2008-09-01 Thread Derek Martin
On Mon, Sep 01, 2008 at 08:40:42AM +0200, Diez B. Roggisch wrote: > Johny schrieb: > >To get a number of the http processes running on my Linux( Debia box) > >I use > >ps -ef | grep "[h]ttpd" | wc -l [...] > The shell does the exact same thing. And by the way: i think you miss a > > grep -v grep

Re: Processes in Linux from Python

2008-09-01 Thread Wojtek Walczak
On Sun, 31 Aug 2008 23:25:56 -0700 (PDT), Johny wrote: > To get a number of the http processes running on my Linux( Debia box) > I use > ps -ef | grep "[h]ttpd" | wc -l ... > So my question is: > Is it possible to get a number of the http processes running on Linux > directly from Python ? Yes, i

Re: Processes in Linux from Python

2008-09-01 Thread Christian Heimes
Johny wrote: Is it possible to get a number of the http processes running on Linux directly from Python ? The Python core has no direct API for the job. However you can use the virtual /proc/ file system for the job. Or check out my enumprocess package. http://pypi.python.org/pypi?:action=di

Re: Processes in Linux from Python

2008-08-31 Thread Diez B. Roggisch
Johny schrieb: To get a number of the http processes running on my Linux( Debia box) I use ps -ef | grep "[h]ttpd" | wc -l But If I want to use to get a number of the http processes from my Python program I must use a popen command e.g. popen2.popen3('ps -ef | grep "[h]ttpd" | wc -l') that is

Processes in Linux from Python

2008-08-31 Thread Johny
To get a number of the http processes running on my Linux( Debia box) I use ps -ef | grep "[h]ttpd" | wc -l But If I want to use to get a number of the http processes from my Python program I must use a popen command e.g. popen2.popen3('ps -ef | grep "[h]ttpd" | wc -l') that is I must call an ex