tqdm - A fast, scalable progress bar for Python.
tqdm (pronounced: taqadum, تقدّم) means progress in Arabic. tqdm can add a progress prompt message in a long loop. Users only need to encapsulate any iterator tqdm (iterator). It is a fast and highly scalable progress bar tool library.
most basic usage
import time
from tqdm import *
for i in tqdm(range(5000)):
time.sleep(.01)
- 1
- 2
- 3
- 4
- 5
iterable tqdm
text = ""
for char in tqdm(["a", "b", "c", "d"]):
text = text + char
- 1
- 2
- 3
trange(i) is a special instance of tqdm(i)
for i in trange(100):
print(i)
- 1
- 2
Allows manual control of tqdm() for loops outside of instances
pbar = tqdm(["a", "b", "c", "d"])
for char in pbar:
pbar.set_description("Processing %s" % char)
- 1
- 2
- 3
references
https://github.com/tqdm/tqdm/tree/master/examples
https://pypi.python.org/pypi/tqdm