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

Re: Listing children processes

24 views
Skip to first unread message

Chris Rebert

unread,
Feb 28, 2012, 4:35:47 PM2/28/12
to Mihai Badoiu, Python list
On Tue, Feb 28, 2012 at 10:33 AM, Mihai Badoiu <mba...@gmail.com> wrote:
> I'm trying to compute the total CPU load of an external process and it's
> children.  (so I cannot use resource.getrusage)  For the load of the process
> I can just grab it from /proc/X/stat.  How do I get the CPU load of the
> children processes?  Is there an easy way to get a list of the children
> processes?

http://code.google.com/p/psutil/

Cheers,
Chris

Arnaud Delobelle

unread,
Feb 28, 2012, 4:47:00 PM2/28/12
to Mihai Badoiu, Python list
On 28 February 2012 21:39, Mihai Badoiu <mba...@gmail.com> wrote:
> Looked at that before.  psutil doesn't do children.
>
> --mihai

Please don't top-post! Also, psutil.Process.get_children() looks to
me like it "does" children.

--
Arnaud

Mark Lawrence

unread,
Feb 28, 2012, 6:41:16 PM2/28/12
to pytho...@python.org
You are incorrect. I've been told of by the BDFL for stating that
people should not top post on any Python mailing list/news group.

--
Cheers.

Mark Lawrence.

Dave Angel

unread,
Feb 28, 2012, 7:03:05 PM2/28/12
to Mark Lawrence, pytho...@python.org
What does the BDFL have to do with the usefulness of psutil?

I'm not likely to download it, but here's a ref from the docs:

<http://code.google.com/p/psutil/wiki/Documentation>http://code.google.com/p/psutil/wiki/Documentation

get_open_files()
Return files opened by process as a list of namedtuples including file
absolute path name and file descriptor. Example:
>>> import psutil, os
>>> f = open('file.ext', 'w')
>>> p = psutil.Process(os.getpid())
>>> p.get_open_files()
[openfile(path='/home/giampaolo/svn/psutil/file.ext', fd=3)]




--

DaveA

Ben Finney

unread,
Feb 28, 2012, 7:16:24 PM2/28/12
to
Mark Lawrence <bream...@yahoo.co.uk> writes:

> On 28/02/2012 21:47, Arnaud Delobelle wrote:

> > Please don't top-post! Also, psutil.Process.get_children() looks to
> > me like it "does" children.
>
> You are incorrect.

Incorrect? The only factual statement Arnaud made was about ‘psutil’.

> I've been told of by the BDFL for stating that people should not top
> post on any Python mailing list/news group.

Fortunately, the BDFL is not a position of authority outside the Python
language. We as a community have the long-standing consensus that
top-posting is to be avoided.

--
\ “Don't be misled by the enormous flow of money into bad defacto |
`\ standards for unsophisticated buyers using poor adaptations of |
_o__) incomplete ideas.” —Alan Kay |
Ben Finney

Steven D'Aprano

unread,
Feb 28, 2012, 7:16:27 PM2/28/12
to
On Tue, 28 Feb 2012 23:41:16 +0000, Mark Lawrence wrote:

> I've been told of by the BDFL for stating that
> people should not top post on any Python mailing list/news group.

He's the BDFL of Python, not of mailing list etiquette.


--
Steven

Mark Lawrence

unread,
Feb 28, 2012, 8:37:31 PM2/28/12
to pytho...@python.org
Incorrect, I was told off for this

http://code.activestate.com/lists/python-ideas/14065/

Please don't bother apologising as I don't want to read another of your
versions of War and Peace.

--
Cheers.

Mark Lawrence.

Ben Finney

unread,
Feb 29, 2012, 12:12:41 AM2/29/12
to
Mark Lawrence <bream...@yahoo.co.uk> writes:

> On 29/02/2012 00:16, Steven D'Aprano wrote:
> > On Tue, 28 Feb 2012 23:41:16 +0000, Mark Lawrence wrote:
> >> I've been told of by the BDFL for stating that people should not
> >> top post on any Python mailing list/news group.
> >
> > He's the BDFL of Python, not of mailing list etiquette.
>
> Incorrect

What Steven says is correct: the BDFL of Python has no special authority
over mailing list etiquette.

> I was told off for this

No-one's saying you weren't told off. We're saying that there's no point
invoking the BDFL when it comes to mailing list etiquette, as he has no
special authority on that.

> Please don't bother apologising

I doubt anyone feels compelled to apologise to you for this.

--
\ “In the long run nothing can withstand reason and experience, |
`\ and the contradiction which religion offers to both is all too |
_o__) palpable.” —Sigmund Freud |
Ben Finney

Giampaolo Rodolà

unread,
Feb 29, 2012, 9:41:19 AM2/29/12
to Arnaud Delobelle, Python list
Il 28 febbraio 2012 22:47, Arnaud Delobelle <arn...@gmail.com> ha scritto:
> On 28 February 2012 21:39, Mihai Badoiu <mba...@gmail.com> wrote:
>> On Tue, Feb 28, 2012 at 4:35 PM, Chris Rebert <cl...@rebertia.com> wrote:
>>>
>>> On Tue, Feb 28, 2012 at 10:33 AM, Mihai Badoiu <mba...@gmail.com> wrote:
>>> > I'm trying to compute the total CPU load of an external process and it's
>>> > children.  (so I cannot use resource.getrusage)  For the load of the
>>> > process
>>> > I can just grab it from /proc/X/stat.  How do I get the CPU load of the
>>> > children processes?  Is there an easy way to get a list of the children
>>> > processes?
>>>
>>> http://code.google.com/p/psutil/
>>>
>>> Cheers,
>>> Chris
>
>> Looked at that before.  psutil doesn't do children.

Yes, it does:

>>> import psutil, os
>>> p = psutil.Process(os.getpid())
>>> p.get_children()
[ ... list of process children ... ]
>>>


--- Giampaolo
code.google.com/p/pyftpdlib/
code.google.com/p/psutil/
code.google.com/p/pysendfile/

Prasad, Ramit

unread,
Feb 29, 2012, 1:09:42 PM2/29/12
to pytho...@python.org
>>> I've been told of by the BDFL for stating that
>>> people should not top post on any Python mailing list/news group.

>> He's the BDFL of Python, not of mailing list etiquette.

>Incorrect, I was told off for this
>http://code.activestate.com/lists/python-ideas/14065/

Why the link? If that is supposed to show how you were told off,
I do not see it. Even if it were, I still agree with Steven + Ben.

Or maybe that's what I get for trying to RTFA.

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--


-----Original Message-----
From: python-list-bounces+ramit.prasad=jpmorg...@python.org [mailto:python-list-bounces+ramit.prasad=jpmorg...@python.org] On Behalf Of Mark Lawrence
Sent: Tuesday, February 28, 2012 7:38 PM
To: pytho...@python.org
Subject: Re: Listing children processes

On 29/02/2012 00:16, Steven D'Aprano wrote:
> On Tue, 28 Feb 2012 23:41:16 +0000, Mark Lawrence wrote:
>
>
>

Please don't bother apologising as I don't want to read another of your
versions of War and Peace.

--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.
0 new messages