Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21041 > unrolled thread

Re: Listing children processes

Started byGiampaolo Rodolà <g.rodola@gmail.com>
First post2012-02-29 15:41 +0100
Last post2012-02-29 15:41 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Listing children processes Giampaolo Rodolà <g.rodola@gmail.com> - 2012-02-29 15:41 +0100

#21041 — Re: Listing children processes

FromGiampaolo Rodolà <g.rodola@gmail.com>
Date2012-02-29 15:41 +0100
SubjectRe: Listing children processes
Message-ID<mailman.294.1330526482.3037.python-list@python.org>
Il 28 febbraio 2012 22:47, Arnaud Delobelle <arnodel@gmail.com> ha scritto:
> On 28 February 2012 21:39, Mihai Badoiu <mbadoiu@gmail.com> wrote:
>> On Tue, Feb 28, 2012 at 4:35 PM, Chris Rebert <clp2@rebertia.com> wrote:
>>>
>>> On Tue, Feb 28, 2012 at 10:33 AM, Mihai Badoiu <mbadoiu@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/

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web