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 sys
2import time
3
4def progressBar(length, totalTime):
5 t = totalTime / length
6
7 sys.stdout.write("[{}]".format(" " * length))
8 sys.stdout.write("\b" * (length + 1))
9 sys.stdout.flush()
10
11 for i in range(length):
12 sys.stdout.write("-")
13 sys.stdout.flush()
14 time.sleep(t)
15
16progressBar(30, 2) # first value = the length of the progress bar
17 # second value = the total of time to fill the progress bar
18
19# Code by Yoann Bertel