On Nov 23, 8:32 pm, Cousin Stanley <cousinstan...@gmail.com> wrote: > >> .... > >> You misunderstand what "flush" means. It is not about > >> clearing the screen, or the line. > > >> Try printing > > >> stdout.write('\r-->%d') > > >> Diez > > > 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 .... > > import sys > import time > > print > > for n in range( 11 ) : > sys.stdout.write( '\r Working ----> %d ' % n ) > sys.stdout.flush() > time.sleep( 1 ) > > else : > print "\n" > print " That's all, folks !" > print " Adios ........... " > > -- > Stanley C. Kitching > Human Being > Phoenix, Arizona
Thanks. It works. Put some space at the end of the output string. -- http://mail.python.org/mailman/listinfo/python-list