How does os.popen works ?

Rouk cuny at
Sat Feb 8 16:37:02 CET 2003

Hello, i have a problem with os.popen function.

It seems that the command that is launched must be finished before one 
can read from the pipe which was opened.

I made a script called that writes several lines on stdout with a 
pause of one second between them.

Following code wait until all lines have been written.
>>> a = os.popen("./", "r", 0)
>>> a.readline()

How can i do to get the lines as soon as they are written to stdout ?
I havn't found anything about it on the web...

Thanks !

More information about the Python-list mailing list