Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.044 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'compute': 0.09; 'am,': 0.12; '4:35': 0.16; 'cc:name:python list': 0.16; 'cc:addr:python- list': 0.16; 'looked': 0.16; 'wrote:': 0.18; '>>>': 0.18; 'cheers,': 0.20; 'trying': 0.21; 'received:209.85.210.174': 0.21; 'received:mail-iy0-f174.google.com': 0.21; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'feb': 0.22; 'load': 0.26; 'import': 0.27; 'cc:addr:gmail.com': 0.28; 'url:code': 0.28; "i'm": 0.28; 'message-id:@mail.gmail.com': 0.29; 'cc:addr:python.org': 0.29; 'pm,': 0.29; '(so': 0.30; 'chris': 0.30; '---': 0.31; 'tue,': 0.32; 'list': 0.32; 'there': 0.33; 'from:charset:iso-8859-1': 0.35; '...': 0.35; 'external': 0.35; 'cc:2**1': 0.36; 'received:google.com': 0.37; 'received:209.85': 0.38; 'received:209': 0.39; 'cannot': 0.39; 'easy': 0.60; 'header:Received:6': 0.61; 'total': 0.61; 'url:p': 0.62; 'grab': 0.66; 'children.': 0.74; '10:33': 0.84; 'febbraio': 0.84 Received-SPF: pass (google.com: domain of g.rodola@gmail.com designates 10.43.45.10 as permitted sender) client-ip=10.43.45.10; Authentication-Results: mr.google.com; spf=pass (google.com: domain of g.rodola@gmail.com designates 10.43.45.10 as permitted sender) smtp.mail=g.rodola@gmail.com; dkim=pass header.i=g.rodola@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=BdzCUE2u+jn9Pg/eHCowwC15dmb3vIpbZWgKm7aIK+Y=; b=HDu6GbYAQ6c1O5frU5HhbJB5MssP+YGvKAihic+D7LzGdWdVu4dEna/UeQbhax2tiT +Wa6mfd1K578WYm7opqma956mKr9h22FjBtWdY4x+kToZt8fSaR0vM3jjCqbaSUNAKBz lhVJ9xmvNN75GYPCbZkDysWKMBqQOX8p3+zvI= MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 29 Feb 2012 15:41:19 +0100 Subject: Re: Listing children processes From: =?ISO-8859-1?Q?Giampaolo_Rodol=E0?= To: Arnaud Delobelle Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Python list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1330526482 news.xs4all.nl 6946 [2001:888:2000:d::a6]:53250 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:21041 Il 28 febbraio 2012 22:47, Arnaud Delobelle ha scritto: > On 28 February 2012 21:39, Mihai Badoiu wrote: >> On Tue, Feb 28, 2012 at 4:35 PM, Chris Rebert wrote: >>> >>> On Tue, Feb 28, 2012 at 10:33 AM, Mihai Badoiu wrot= e: >>> > I'm trying to compute the total CPU load of an external process and i= t's >>> > children.=A0 (so I cannot use resource.getrusage)=A0 For the load of = the >>> > process >>> > I can just grab it from /proc/X/stat.=A0 How do I get the CPU load of= the >>> > children processes?=A0 Is there an easy way to get a list of the chil= dren >>> > processes? >>> >>> http://code.google.com/p/psutil/ >>> >>> Cheers, >>> Chris > >> Looked at that before.=A0 psutil doesn't do children. Yes, it does: >>> import psutil, os >>> p =3D 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/