On Mon, 14 May 2007 20:56:20 +0000 Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
> Hi, > > I would like to track the cpu usage of a couple of > programs using python. Maybe it works somehow with > piping 'top' to python read the cpu load for a greped > application and clocking the the first and last > appearence. Is that a good approach or does anyone have > a more elegant way to do that? Look at the /proc filesystem instead. For example, you can do this: cat /proc/49595/status To get information about that process. Using this you can find out anything you need with just basic file operations. Use: man proc to find our more. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ -- http://mail.python.org/mailman/listinfo/python-list