Monitoring external processes

Discussion in 'Python' started by arunasunil@gmail.com, Oct 23, 2007.

  1. Guest

    Hi,

    Is there a way to track external processes launched by python on the
    Mac? I am using subprocess module to launch the process.

    Thanks
    Sunil
     
    , Oct 23, 2007
    #1
    1. Advertising

  2. On Oct 23, 3:09 pm, wrote:
    > Hi,
    >
    > Is there a way to track external processes launched by python on the
    > Mac? I am using subprocess module to launch the process.
    >
    > Thanks
    > Sunil


    If using Python 2.3/2.4, you can use os.wait().

    If using Python 2.5, there is also have os.wait3() and os.wait4().

    See the operating system manual pages for the difference. Ie.,

    man wait4

    Graham
     
    Graham Dumpleton, Oct 23, 2007
    #2
    1. Advertising

  3. On 10/23/07, <> wrote:
    > Is there a way to track external processes launched by python on the
    > Mac? I am using subprocess module to launch the process.


    Depending on how much detail you are looking for, PSI might be worth a look.

    http://www.psychofx.com/psi/

    --
    Cheers,
    Simon B.

    http://www.brunningonline.net/simon/blog/
    GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues
     
    Simon Brunning, Oct 23, 2007
    #3
  4. Guest

    On Oct 22, 11:33 pm, Graham Dumpleton <>
    wrote:
    > On Oct 23, 3:09 pm, wrote:
    >
    > > Hi,

    >
    > > Is there a way to track external processes launched by python on the
    > > Mac? I am using subprocess module to launch the process.

    >
    > > Thanks
    > > Sunil

    >
    > If using Python 2.3/2.4, you can use os.wait().
    >
    > If using Python 2.5, there is also have os.wait3() and os.wait4().
    >
    > See the operating system manual pages for the difference. Ie.,
    >
    > man wait4
    >
    > Graham


    Ah! Exactly what I needed.

    Thanks
    Sunil.
     
    , Oct 23, 2007
    #4
  5. Guest

    On Oct 22, 11:33 pm, Graham Dumpleton <>
    wrote:
    > On Oct 23, 3:09 pm, wrote:
    >
    > > Hi,

    >
    > > Is there a way to track external processes launched by python on the
    > > Mac? I am using subprocess module to launch the process.

    >
    > > Thanks
    > > Sunil

    >
    > If using Python 2.3/2.4, you can use os.wait().
    >
    > If using Python 2.5, there is also have os.wait3() and os.wait4().
    >
    > See the operating system manual pages for the difference. Ie.,
    >
    > man wait4
    >
    > Graham


    I'm having a slight problem using wait3 or wait4. I want monitor a
    launched process and get its resource usage information. When I call
    os.wait4 with the pid the first time the call returns successfully but
    the second time around I get a OSError with "No child processes"
    error. I have tried using WCONTINUED, WNOHANG and WUNTRACED options.

    Sunil.
     
    , Oct 23, 2007
    #5
    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. Darren Smith

    External Processes

    Darren Smith, Oct 12, 2004, in forum: Perl
    Replies:
    1
    Views:
    474
    J├╝rgen Exner
    Oct 12, 2004
  2. Jeff Rodriguez
    Replies:
    23
    Views:
    1,159
    David Schwartz
    Dec 9, 2003
  3. Caleb Marcus
    Replies:
    0
    Views:
    295
    Caleb Marcus
    Dec 13, 2007
  4. Replies:
    13
    Views:
    560
    mach7
    Feb 1, 2008
  5. Marc Heiler
    Replies:
    1
    Views:
    183
    Robert Klemme
    May 24, 2009
Loading...

Share This Page