Python Progress Bar
Text Progress Bar in the Console
So I'm working on a basic program and I'm trying to make two things:
A Loading... text line where the dots increase in this manner:
An increasing percent in one line:
So, my question is how do I remove/replace printed text? I want these things to happen on one line. For the first example, how do I replace the 3 dots with just 1, or just erase the 2 on the end (without going to the next line)? For the second example, how do I make the percent increase while staying on the same line?
>>> for i in range(100): ... time.sleep(1) ... sys.stdout.write("\r%d%%" %i) # or print >> sys.stdout, "\r%d%%" %i, ... sys.stdout.flush() ...
This will help you with the percentage.