Skip to content

Instantly share code, notes, and snippets.

@gatheluck
Created July 1, 2019 09:16
Show Gist options
  • Save gatheluck/f61186185a84073730d579cc34cd36f2 to your computer and use it in GitHub Desktop.
Save gatheluck/f61186185a84073730d579cc34cd36f2 to your computer and use it in GitHub Desktop.
simple progress meter by tqdm.
from tqdm import tqdm
import time
from collections import OrderedDict
from random import random
with tqdm(range(10000), ncols=10) as pbar:
for i in pbar:
pbar.set_postfix(OrderedDict(
output='{:06d}'.format(i),
loss='{:.4f}'.format(random())
))
time.sleep(0.01)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment