Created
May 23, 2021 22:01
-
-
Save bjlittle/307130907a37532c2e93f464b82551d9 to your computer and use it in GitHub Desktop.
vaccination progress bar
This file contains 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 os | |
import sys | |
from time import sleep | |
from tqdm import trange | |
os.system("clear") | |
os.system("setterm -cursor off") | |
print("\n" * 12) | |
format_str = "{desc} {percentage:3.0f}% |{bar}| {postfix[0]} {postfix[1][jab]} " | |
with trange( | |
10, bar_format=format_str, colour="blue", postfix=["Jab=", dict(jab="ππ")] | |
) as tq: | |
tq.set_description(" Vaccination") | |
for i in tq: | |
if i == 5: | |
sleep(2) | |
else: | |
sleep(0.1) | |
if i == 4: | |
tq.postfix[1]["jab"] = "ππ" | |
if i == 9: | |
tq.postfix[1]["jab"] = "ππ" | |
print("\n Stay Safe. ", end="", flush=True) | |
sleep(1) | |
print("Stay Healthy. ", end="", flush=True) | |
sleep(1) | |
print("Wear a Mask. π·") | |
sleep(10) | |
os.system("setterm -cursor on") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment