我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用progressbar.AnimatedMarker()。
def _create_pbar(self, max_iter): """ Creates a progress bar. """ self.grad_iter = 0 self.pbar = pb.ProgressBar() self.pbar.widgets = ["Optimizing: ", pb.Percentage(), " ", pb.Bar(marker=pb.AnimatedMarker()), " ", pb.ETA()] self.pbar.maxval = max_iter
def __init__(self): self.lines = [] self.line_acc = [] self.duration = None self.source = None self.started = False self.pbar = progressbar.ProgressBar(widgets=[ lambda w, d: self.source, ' ', progressbar.AnimatedMarker( markers="—/|\\", ), progressbar.Bar( marker='?', fill='?', left=' ?', right='? ', ), progressbar.Percentage( '%(percentage)3d% % ' ), progressbar.Timer( format='(%(elapsed)s / ' ), AbsoluteTimeETA( format='%(eta)s)', format_finished='%(elapsed)s', format_not_started='--:--:--' ), ])