Simple (?) question about print statement
Fredrik Lundh
fredrik at pythonware.com
Wed Dec 14 16:32:24 EST 2005
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 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
it's more like mixing fprintf and fwrite.
> and I'm probably just paranoid.
might be, might be.
</F>
More information about the Python-list
mailing list