1from tqdm import tdqm
2
3LENGTH = 10 # Number of iterations required to fill pbar
4
5pbar = tqdm(total=LENGTH) # Init pbar
6for i in range(LENGTH):
7 pbar.update(n=1) # Increments counter
1import time
2from console_progressbar import ProgressBar
3
4pb = ProgressBar(total=100,prefix='Here', suffix='Now', decimals=3, length=50, fill='X', zfill='-')
5pb.print_progress_bar(2)
6time.sleep(5)
7pb.print_progress_bar(25)
8time.sleep(5)
9pb.print_progress_bar(50)
10time.sleep(5)
11pb.print_progress_bar(95)
12time.sleep(5)
13pb.print_progress_bar(100)
14
1from tqdm import trange
2from time import sleep
3t = trange(100, desc='Bar desc', leave=True)
4for i in t:
5 t.set_description("Bar desc (file %i)" % i) # add dynamic bar description
6 t.refresh() # to show immediately the update
7 sleep(0.01)
1import time
2import sys
3
4toolbar_width = 40
5
6# setup toolbar
7sys.stdout.write("[%s]" % (" " * toolbar_width))
8sys.stdout.flush()
9sys.stdout.write("\b" * (toolbar_width+1)) # return to start of line, after '['
10
11for i in xrange(toolbar_width):
12 time.sleep(0.1) # do real work here
13 # update the bar
14 sys.stdout.write("-")
15 sys.stdout.flush()
16
17sys.stdout.write("]\n") # this ends the progress bar
18