Created
February 17, 2017 05:49
-
-
Save Keiku/5940f9bfcd17a34b950222eafafd29b7 to your computer and use it in GitHub Desktop.
Print progress bar.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from tqdm import tqdm | |
pbar = tqdm(["1", "2", "3", "4", "5"]) | |
for char in pbar: | |
pbar.set_description("Processing %s" % char) | |
time.sleep(1) | |
# 0%| | 0/5 [00:00<?, ?it/s] | |
# Processing 1: 20%|██████▏ | 1/5 [00:01<00:04, 1.00s/it] | |
# Processing 2: 40%|████████████▍ | 2/5 [00:02<00:03, 1.00s/it] | |
# Processing 3: 60%|██████████████████▌ | 3/5 [00:03<00:02, 1.00s/it] | |
# Processing 4: 80%|████████████████████████▊ | 4/5 [00:04<00:01, 1.00s/it] | |
# Processing 5: 100%|███████████████████████████████| 5/5 [00:05<00:00, 1.00s/it] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment