# a simple progress bar import time import sys progressbar_width = 40 sys.stdout.write("[%s]" % (" " * progressbar_width)) sys.stdout.flush() sys.stdout.write("\b" * (progressbar_width + 1)) # return to start of line, after '[' for i in range(progressbar_width): time.sleep(0.1) sys.stdout.write("-") sys.stdout.flush() sys.stdout.write("]\n") # this ends the progress bar