Pipes (in Python)
Hey,
I am currently working on a project in which I am using python to communicate with a c++ program. I need to perform a sequence of reads and writes via pipes.
All the examples I've seen are follow the following structure:-
Open two way pipe
write to pipe
close write end
read from pipe
close read end
I don't want to close the write or read end since I will need to send further data later. If I don't close the write end the program hangs. Is this due to the way pipes work? What is the normal solution in this case, do I need to open a new pipe?
In my case I am using python with the following pipe command
fout, fin = os.popen2("./a.out", "t")
Any help would be much appreciated :-)
|