469,923 Members | 1,282 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

os.execlp and stdout

In a Python script I start a number of C++ processes using os.execlp. Most
of these processes output messages for debugging purposes at this time. The
problem I am having is that by starting 4 or 5 processes from my Python
script I don't get the cout messages they write. I have tried redirecting
stdout to a file but I get everything but the output from the C++ processes.
Any suggestions.

Thanks
Melissa
Jul 18 '05 #1
1 3451
"Melissa Wallis" <mw*****@swri.org> wrote in message news:<10*************@corp.supernews.com>...
In a Python script I start a number of C++ processes using os.execlp. Most
of these processes output messages for debugging purposes at this time. The
problem I am having is that by starting 4 or 5 processes from my Python
script I don't get the cout messages they write. I have tried redirecting
stdout to a file but I get everything but the output from the C++ processes.
Any suggestions.


They may be writing to stdout, but that doesn't mean it goes to your screen.
How are you starting the processes? You must first be calling fork
and then calling execlp. It would be good if you explained how you
create your child processes -- show an example from your code.
Probably your child processes are getting disconnected from your tty so their
output goes nowhere. Usually this is what you want to happen and most
fork/exec examples will do this. ... On the other hand, the very simplest
fork/exec should cause your child processes to use the
same stdout as the parent. Since you are not seeing this it makes me
suspect that your code is doing something extra to prevent this.

Yours,
Noah
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Leon | last post: by
4 posts views Thread by Paul Nilsson | last post: by
6 posts views Thread by Erik S. Bartul | last post: by
9 posts views Thread by Santtu Nyrhinen | last post: by
5 posts views Thread by =?gb2312?B?yMvR1MLkyNXKx8zs0cSjrM37vKvM7NHEsru8+7z | last post: by
6 posts views Thread by druidamix | last post: by
5 posts views Thread by Joakim Hove | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.