Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from tqdm import trange
iterations = 10
pbar = trange(iterations, unit="carrots")
for i in pbar:
sleep(0.5)
if i % 2:
pbar.set_description(f"Testing odd number {i}")
else:
pbar.set_description(f"Testing even number {i}")
pbar.set_postfix(divisors=get_divisors(i))
pbar.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment