Sean Reifschneider added the comment:
I do not believe this is a Python problem but instead a problem with
your code. I believe the problem is likely that you still have a copy
of the stdout is open, the fork that is reading also gets associated
with that same file. I can't point you at any
New submission from Luís Pedro Coelho:
from os import *
def Fork():
b = fork()
if b 0:
raise Exception('fork() failed')
return b
r,w=pipe()
b = Fork()
if b == 0:
dup2(w,1)
close(w)
execlp('echo',\
'echo',\
'Hello world')
else:
for line in