RE: How to get process info from python

Discussion in 'Python' started by Gardner Pomper, Jun 7, 2004.

  1. Thanks for the suggestion, but I have already looked at those modules. Do
    you have a command in mind? I can only find process information about the
    python process and its parents and children.. if I want to see a list of all
    processes on the system, or all processes for the current user, I don't see
    any way to get that.

    - Gardner

    > -----Original Message-----
    > From: python-list-bounces+gardner=
    > [mailto:python-list-bounces+gardner=]On Behalf
    > Of vs
    > Sent: Monday, June 07, 2004 5:31 PM
    > To:
    > Subject: Re: How to get process info from python
    >
    >
    > "Gardner Pomper" <> wrote in message
    > news:<>...
    > > Hi,
    > >
    > > I have another newbie question for the list. I have some python

    > scripts that
    > > need to look at the list of processes running on the system. I

    > am currently
    > > just spawning a 'ps' and parsing the output. Are there any

    > existing python
    > > modules to do this? It would be particularly handy to have it be more
    > > platform independent than my solution, which works only on AIX.
    > >
    > > - Gardner

    >
    >
    > Try the os,sys modules that comes with python. They help u in
    > interfacing with the OS directly.
    > - vinodh
    > --
    > http://mail.python.org/mailman/listinfo/python-list
     
    Gardner Pomper, Jun 7, 2004
    #1
    1. Advertising

  2. Gardner Pomper

    Donn Cave Guest

    In article <>,
    "Gardner Pomper" <> wrote:
    > Thanks for the suggestion, but I have already looked at those modules. Do
    > you have a command in mind? I can only find process information about the
    > python process and its parents and children.. if I want to see a list of all
    > processes on the system, or all processes for the current user, I don't see
    > any way to get that.


    There isn't any support for this in Python. Normally when saying
    something like that, I could half expect someone to pop up with
    a module or something, but in this case I feel relatively confident
    that no such module is widely supported.

    On Linux and *BSD platforms, you can get this information from the
    /proc filesystem instead of "ps", but it's still fairly platform
    dependent. Of course that won't work on AIX.

    Donn Cave,
     
    Donn Cave, Jun 8, 2004
    #2
    1. Advertising

  3. On Mon, 7 Jun 2004 17:48:44 -0400,
    "Gardner Pomper" <> wrote:

    > Thanks for the suggestion, but I have already looked at those
    > modules. Do you have a command in mind? I can only find process
    > information about the python process and its parents and
    > children.. if I want to see a list of all processes on the
    > system, or all processes for the current user, I don't see any
    > way to get that.


    Additionally, there may be permissions/security issues: some
    unices don't let anyone but root see someone else's processes.

    Regards,
    Heather

    --
    Heather Coppersmith
    That's not right; that's not even wrong. -- Wolfgang Pauli
     
    Heather Coppersmith, Jun 8, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vasanth
    Replies:
    0
    Views:
    561
    Vasanth
    Jun 28, 2004
  2. Gardner Pomper

    How to get process info from python

    Gardner Pomper, Jun 7, 2004, in forum: Python
    Replies:
    1
    Views:
    402
  3. Gardner Pomper

    RE: How to get process info from python

    Gardner Pomper, Jun 8, 2004, in forum: Python
    Replies:
    1
    Views:
    629
    Nick Vargish
    Jun 8, 2004
  4. Gardner Pomper

    RE: How to get process info from python

    Gardner Pomper, Jun 9, 2004, in forum: Python
    Replies:
    2
    Views:
    1,250
    Jean Brouwers
    Jun 12, 2004
  5. ilya

    get CPU info, RAM info

    ilya, Apr 8, 2010, in forum: Java
    Replies:
    43
    Views:
    6,013
    Mike Schilling
    Apr 19, 2010
Loading...

Share This Page