Skip to content

Instantly share code, notes, and snippets.

@adamoudad
Last active October 13, 2020 21:57
Show Gist options
  • Save adamoudad/581a27f9e383aeba2ed5d229af6bad54 to your computer and use it in GitHub Desktop.
Save adamoudad/581a27f9e383aeba2ed5d229af6bad54 to your computer and use it in GitHub Desktop.
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