Skip to content

Instantly share code, notes, and snippets.

@wjt
Created July 9, 2015 16:49
Show Gist options
  • Save wjt/81542cabad0b566f5ff6 to your computer and use it in GitHub Desktop.
Save wjt/81542cabad0b566f5ff6 to your computer and use it in GitHub Desktop.
I've written essentially this many times in the last 18 months.
class Reticulator(object):
def __init__(self, n):
self.n = n
self.i = 0
def tick(self):
self.i += 1
if (self.i - 1) % 100 == 0 or self.i + 1 >= self.n:
sys.stderr.write('[{}/{}]\r'.format(self.i, self.n))
@wjt
Copy link
Author

wjt commented Jul 9, 2015

One incarnation I wrote at GSA had a spinner, estimated time remaining, etc. Wish I'd written it in my spare time so I could have kept it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment