On Sun, Mar 8, 2009 at 1:37 AM, Daniel Dalton <d.dal...@iinet.net.au> wrote: > Hi, > > I've got a program here that prints out a percentage of it's > completion. Currently with my implimentation it prints like this: > 0% > 1% > 2% > 3% > 4% > > etc taking up lots and lots of lines of output... So, how can I make it > write the percentage on the same line eg. > while working: > print percent
Use the carriage return character to overwrite the line (you'll need to forego `print`): from sys import stdout while working: stdout.write('\r'+percent) Note that you'll need to ensure that `percent` has constant length throughout the loop. Cheers, Chris -- I have a blog: http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list