Created
July 9, 2015 16:49
-
-
Save wjt/81542cabad0b566f5ff6 to your computer and use it in GitHub Desktop.
I've written essentially this many times in the last 18 months.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.