sys.stdout is not flushed
cousinstanley at gmail.com
Tue Nov 24 03:32:50 CET 2009
>> You misunderstand what "flush" means. It is not about
>> clearing the screen, or the line.
>> Try printing
> But there is still a problem. When you use control character '\r',
> you actually move to the head of the current buffer line and
> overwrite it.
> So if I use this way:
> for i in range(100, 0,-1)
> The tail of the buffer is not overwrote.
The following version works ok for me
using python2.5 under debian linux ....
for n in range( 11 ) :
sys.stdout.write( '\r Working ----> %d ' % n )
time.sleep( 1 )
print " That's all, folks !"
print " Adios ........... "
Stanley C. Kitching
More information about the Python-list