Skip to content

Instantly share code, notes, and snippets.

@bjlittle
Created May 23, 2021 22:01
Show Gist options
  • Save bjlittle/307130907a37532c2e93f464b82551d9 to your computer and use it in GitHub Desktop.
Save bjlittle/307130907a37532c2e93f464b82551d9 to your computer and use it in GitHub Desktop.
vaccination progress bar
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