Something that Perl can do that Python can't?

Dr. Who google at spiceaid.com
Fri Jul 22 17:07:18 EDT 2005


Well, I finally managed to solve it myself by looking at some code.
The solution in Python is a little non-intuitive but this is how to get
it:

while 1:
    line = stdout.readline()
    if not line:
        break
    print 'LINE:', line,

If anyone can do it the more Pythonic way with some sort of iteration
over stdout, please let me know.

Jeff




More information about the Python-list mailing list