diff options
Diffstat (limited to 'tools.py')
-rw-r--r-- | tools.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -13,8 +13,9 @@ def progress(seq): n = len(seq) print '[' + ' '*21 + ']\r[', sys.stdout.flush() + update_interval = max(n // 10, 1) for i, item in enumerate(seq): - if i % (n//10) == 0: + if i % update_interval == 0: print '.', sys.stdout.flush() yield item |