Monitoring external processes

A

arunasunil

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
 
G

Graham Dumpleton

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
 
A

arunasunil

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.
 
A

arunasunil

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top