Simple (?) question about print statement

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


On 2005-12-14, Fredrik Lundh <fredrik at pythonware.com> wrote:
> Grant Edwards 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?
>
> print uses sys.stdout, so the answer is no.

I presume you mean yes.  After I looked into "print" a bit
more, it was pretty obvious.

[Asking questions in the negative like that is always bad
style. Not sure why I did it.]

-- 
Grant Edwards                   grante             Yow!  Can I have an IMPULSE
                                  at               ITEM instead?
                               visi.com            



More information about the Python-list mailing list