472,146 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

Monitoring external processes

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 '07 #1
4 2206
On Oct 23, 3:09 pm, arunasu...@gmail.com 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

Oct 23 '07 #2
On 10/23/07, ar********@gmail.com <ar********@gmail.comwrote:
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.
si***@brunningonline.net
http://www.brunningonline.net/simon/blog/
GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues
Oct 23 '07 #3
On Oct 22, 11:33 pm, Graham Dumpleton <Graham.Dumple...@gmail.com>
wrote:
On Oct 23, 3:09 pm, arunasu...@gmail.com 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 '07 #4
On Oct 22, 11:33 pm, Graham Dumpleton <Graham.Dumple...@gmail.com>
wrote:
On Oct 23, 3:09 pm, arunasu...@gmail.com 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 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ralf Gross | last post: by
reply views Thread by Paul Steele | last post: by
4 posts views Thread by Bob | last post: by
7 posts views Thread by mojtaba_danai | last post: by
5 posts views Thread by Ben | last post: by
reply views Thread by Saiars | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.