On Fri, Sep 28, 2012 at 10:05 AM, Rikishi42 <skunkwo...@rikishi42.net> wrote: > The scripts in question only increase numbers. But should that not be the > case, solutions are simple enough. The numbers can be formatted to have a > fixed size. In the case of random line contents (a list of filesnames, say) > it's enough to create an output function that is aware of the length of the > previously printed line, and add enough spaces to the current one to wipe > exess content.
Yep, that's a pretty effective way to do it. One simple method to it is to format the whole string as a single whole, then left justify it in a field of (say) 79 characters, and output that: msg = "Progress: %d%% (%d/%d)... %s" % (done*100/total, done, total, current_file) print msg.ljust(79)+"\r", sys.stdout.flush() ChrisA -- http://mail.python.org/mailman/listinfo/python-list