Tqdm
lastmod 2022-07-13created 2022-07-073 edits
A Fast, Extensible Progress Bar for Python and CLI
Example
from tqdm import tqdm
import time
text = ""
for char in tqdm(["a", "b", "c", "d"]):
time.sleep(0.25)
text = text + char
The output looks like this:
Command-line examples
-
time find . -name '*.py' -type f -exec cat \{} \; | tqdm | wc -l - Find
*.pyfiles. The overall percentage is not shown.
-
7z a -bd -r backup.7z docs/ | grep Compressing | tqdm --total $(find docs/ -type f | wc -l) --unit files >> backup.log - Compress with 7z. Adding the
--totalargument shows the overall percentage.