Skip to content

Tqdm

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

다음과 같이 출력된다:

100%|██████████| 4/4 [00:01<00:00,  3.93it/s]

명령행 예제

time find . -name '*.py' -type f -exec cat \{} \; | tqdm | wc -l
*.py파일 찾기. 전체 퍼센트가 출력되지 않는다.
7z a -bd -r backup.7z docs/ | grep Compressing | tqdm --total $(find docs/ -type f | wc -l) --unit files >> backup.log
7z으로 압축하기. --total 인자를 추가하여 전체 퍼센트를 출력한다.

See also

Favorite site