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='█')
| 42 | |
| 43 | |
| 44 | def 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 | |
| 69 | def makeWOFF(files, destination): |
no outgoing calls
no test coverage detected