From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 12 19:45:46 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C1AF16A468 for ; Thu, 12 Jul 2007 19:45:46 +0000 (UTC) (envelope-from jkoshy.freebsd@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by mx1.freebsd.org (Postfix) with ESMTP id 405A213C45A for ; Thu, 12 Jul 2007 19:45:46 +0000 (UTC) (envelope-from jkoshy.freebsd@gmail.com) Received: by wa-out-1112.google.com with SMTP id j37so312081waf for ; Thu, 12 Jul 2007 12:45:45 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:message-id:to:cc:subject:in-reply-to:references:user-agent:mime-version:content-type:from:sender; b=rNMio3TQj72oPGB5jjO059YESPBn6WZ+2a4zK//krI2u8C7Kd5HzJhMahejG/eDX6L1nEKyc1zA0TLU8piUiY7nmsUwNCTPMurFns8+mZ67iNSfTZe4CIn8ykJDgfjA2Qhn5ZyUaVvQUdKxId7AHBrFOVoxu0+7nVP2lijKvyD8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:message-id:to:cc:subject:in-reply-to:references:user-agent:mime-version:content-type:from:sender; b=rS8oNMUvUOPB/n6xoP5h2doiPMzn8Zt04zl9Dycfhic/qicIx4B3ARxcMeqSbNqa/wwWDrG+wQd3s48xDkSO6bfsiH1mWBtZvcFLLT2GpJi9lCIYhD5VuiqiwmECPXKQKmZKvQtLNfugxbtV9C+62RVBt8Ex0YZFgHHQ0QLP/Ik= Received: by 10.115.58.1 with SMTP id l1mr871454wak.1184267795012; Thu, 12 Jul 2007 12:16:35 -0700 (PDT) Received: from moria.unixconsulting.co.in ( [219.64.103.106]) by mx.google.com with ESMTP id v35sm28804585wah.2007.07.12.12.16.30 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 Jul 2007 12:16:34 -0700 (PDT) Date: Fri, 13 Jul 2007 00:47:21 +0000 Message-ID: <86myy16sfa.wl%koshy@moria.unixconsulting.co.in> To: "Mathieu Prevot" In-Reply-To: <3e473cc60707121143n30c5069bse6cf533726c9663e@mail.gmail.com> References: <3e473cc60707121141x20e7088cv13ff409d71e310dd@mail.gmail.com> <3e473cc60707121143n30c5069bse6cf533726c9663e@mail.gmail.com> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/21.3 (amd64--freebsd) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII From: Joseph Koshy Sender: Joseph Koshy Cc: Joseph Koshy , freebsd-hackers@freebsd.org Subject: Re: get active processes in python X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2007 19:45:46 -0000 [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