R
Robert Latest
Hello,
look at this function:
--------------
def test():
child = os.popen('./slow')
for line in child:
print line
-------------
The program "slow" just writes the numbers 0 through 9 on stdout, one line a
second, and then quits.
I would have expected the python program to spit out a numbers one by one,
instead I see nothing for 10 seconds and then the whole output all at once.
How can I get and process the pipe's output at the pace it is generated?
Thanks,
robert
look at this function:
--------------
def test():
child = os.popen('./slow')
for line in child:
print line
-------------
The program "slow" just writes the numbers 0 through 9 on stdout, one line a
second, and then quits.
I would have expected the python program to spit out a numbers one by one,
instead I see nothing for 10 seconds and then the whole output all at once.
How can I get and process the pipe's output at the pace it is generated?
Thanks,
robert