Simple (?) question about print statement

Grant Edwards grante at visi.com
Wed Dec 14 16:19:45 EST 2005


On 2005-12-14, Fredrik Lundh <fredrik at pythonware.com> wrote:

> try this instead:
>
>     import time, sys
>
>     for i in range(10):
>         time.sleep(0.8) # seconds; tune as necessary
>         print i,
>         sys.stdout.flush() # flush stdout
>     print

Is mixing print and sys.stdout.XXXXX never a problem?  

I never do it because it "feels" too much like mixing printf()
and write() on the same file descriptor. But, now that I think
about it I doubt that's a valid analogy, and I'm probably just
paranoid.

-- 
Grant Edwards                   grante             Yow!  The Korean War must
                                  at               have been fun.
                               visi.com            



More information about the Python-list mailing list