classProgressBar: """ 进度条 """ MAX_LENGTH = 25# length of progress bar STYLE_UNDO = '*'# show style of undo STYLE_DONE = '='# show syle of finish def__init__(self, total=100, prefix="Loop"): self.cur = 0 self.total = total self.prefix = prefix defrestart(self, cur=None, total=None): if cur isnotNone: assertisinstance(cur, int), "Error type for cur: {}".format(cur) self.cur = cur if total isnotNone: assertisinstance(total, int), "Error type for total: {}".format(total) self.total = total
classProgressBar: """ 进度条 """ MAX_LENGTH = 25# length of progress bar STYLE_UNDO = '*'# show style of undo STYLE_DONE = '='# show syle of finish def__init__(self, total=100, prefix="Loop"): self.cur = 0 self.total = total self.prefix = prefix defrestart(self, cur=None, total=None): if cur isnotNone: assertisinstance(cur, int), "Error type for cur: {}".format(cur) self.cur = cur if total isnotNone: assertisinstance(total, int), "Error type for total: {}".format(total) self.total = total