473,387 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 3571
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Leon | last post by:
"stdout" is file object, it open mode is "w" and it have a close() fuction..... while it run close(), how to reopen it because I want to do rewrite it stdout content update
4
by: Paul Nilsson | last post by:
Hi, Does anyone know how to redirect text output when issuing a system or an execlp call? I have a GUI that insists on opening up a console whenever I give a system function call, and I would...
6
by: Erik S. Bartul | last post by:
as i understand if, the first argument of execlp() is a null terminated string containing the path of the command which to be executed. the second argument is an array of pointers to null...
9
by: Santtu Nyrhinen | last post by:
Hi, Let say that I have a function like void writeHello() { printf("Hello"); } Now I need to make an automated test fot that function. The test function returns 1 for successful and 0 for...
6
by: rabidmonkey | last post by:
Hi all, I have written a server & child program both are working fine but when the server tries to execute the child program with the line execlp("child","child", parameter, NULL ); nothing...
5
by: =?gb2312?B?yMvR1MLkyNXKx8zs0cSjrM37vKvM7NHEsru8+7z | last post by:
I wanna print the log to both the screen and file, so I simulatered a 'tee' class Tee(file): def __init__(self, name, mode): file.__init__(self, name, mode) self.stdout = sys.stdout...
6
by: druidamix | last post by:
I'm trying to make a gui for an application, but it not run. i'm trying to send the output of execlp to pipe and read from his father. but i don't obtain results. Any advince? Thank you. ...
2
by: manontheedge | last post by:
I'm trying to write a program in C on Linux where the child processes get their process images replaced. I have in my code, a few child processes that I forked from a single parent process. I'm...
5
by: Joakim Hove | last post by:
Hello, I have written a program in C; this programs uses an external proprietary library. When calling a certain function in the external library, the particular function writes a message to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.