Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jul 2007 00:47:21 +0000
From:      Joseph Koshy <jkoshy@FreeBSD.org>
To:        "Mathieu Prevot" <mathieu.prevot@gmail.com>
Cc:        Joseph Koshy <jkoshy@freebsd.org>, freebsd-hackers@freebsd.org
Subject:   Re: get active processes in python
Message-ID:  <86myy16sfa.wl%koshy@moria.unixconsulting.co.in>
In-Reply-To: <3e473cc60707121143n30c5069bse6cf533726c9663e@mail.gmail.com>
References:  <3e473cc60707121141x20e7088cv13ff409d71e310dd@mail.gmail.com>	<3e473cc60707121143n30c5069bse6cf533726c9663e@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[Trimming soc-admins@ from the CC list]

mp> do you recommend a method to get active processes in a python script,
mp> as with "ps" or "top" in order to put the result into a list ? (python
mp> package, shell call...)

One option would be to wrap "kvm_getprocs(3)" and use that.

mp> PS: I would like to fire this regularly, eg every second

This shouldn't be a problem.  Most GUI toolkits offer a way of
registering a callback that will be invoked periodically.

Regards,
Koshy
<jkoshy@freebsd.org>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86myy16sfa.wl%koshy>