MCPcopy
hub / github.com/arrowtype/recursive / printProgressBar

Function printProgressBar

mastering/utils.py:44–66  ·  view source on GitHub ↗

Call in a loop to create terminal progress bar @params: iteration - Required : current iteration (Int) total - Required : total iterations (Int) prefix - Optional : prefix string (Str) suffix - Optional : suffix string (Str) deci

(iteration, total, prefix='', suffix='',
                     decimals=1, length=100, fill='█')

Source from the content-addressed store, hash-verified

42
43
44def printProgressBar(iteration, total, prefix='', suffix='',
45 decimals=1, length=100, fill='█'):
46 """
47 Call in a loop to create terminal progress bar
48 @params:
49 iteration - Required : current iteration (Int)
50 total - Required : total iterations (Int)
51 prefix - Optional : prefix string (Str)
52 suffix - Optional : suffix string (Str)
53 decimals - Optional : positive number of decimals in percent complete (Int)
54 length - Optional : character length of bar (Int)
55 fill - Optional : bar fill character (Str)
56
57 Nabbed, of course, from Stack Overflow
58 (https://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console)
59 """
60 percent = ("{0:."+str(decimals)+"f}").format(100*(iteration/float(total)))
61 filledLength = int(length * iteration // total)
62 bar = fill * filledLength + '-' * (length - filledLength)
63 print('\r%s |%s| %s%% %s' % (prefix, bar, percent, suffix), end='\r')
64 # Print New Line on Complete
65 if iteration == total:
66 print()
67
68
69def makeWOFF(files, destination):

Callers 5

buildTTFfilesFunction · 0.90
buildInstancesFunction · 0.90
makeSFNTFunction · 0.90
makeWOFFFunction · 0.85
batchCheckOutlinesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected