all process list on Linux?
Radovan Garabik
spam at melkor.dnp.fmph.uniba.sk
Wed Nov 28 04:21:02 EST 2001
Brian Lee <senux at senux.com> wrote:
: I'm newbie at Python programming.
: How can I get all processes list on Linux OS? I need PID
: and process name (like the result of ps command). I found
: setproctitle have many usefull function but it is not
: supported on Linux.
: Any modules which return all process list on Linux? Thank
: you for your help. :)
os.listdir('/proc')
then take only numerical directories
--
-----------------------------------------------------------
| Radovan Garabik http://melkor.dnp.fmph.uniba.sk/~garabik |
| __..--^^^--..__ garabik @ fmph . uniba . sk |
-----------------------------------------------------------
Antivirus alert: file .signature infected by signature virus.
Hi! I'm a signature virus! Copy me into your signature file to help me spread!
More information about the Python-list
mailing list