saving works now
This commit is contained in:
17
backend/utils/progress_bar.py
Normal file
17
backend/utils/progress_bar.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import sys
|
||||
|
||||
|
||||
def progressbar(it, prefix="", size=60, file=sys.stdout):
|
||||
count = len(it)
|
||||
|
||||
def show(j):
|
||||
x = int(size * j / count)
|
||||
file.write("%s[%s%s] %i/%i\r" %
|
||||
(prefix, "#" * x, "." * (size - x), j, count))
|
||||
file.flush()
|
||||
show(0)
|
||||
for i, item in enumerate(it):
|
||||
yield item
|
||||
show(i + 1)
|
||||
file.write("\n")
|
||||
file.flush()
|
||||
Reference in New Issue
Block a user