Python progressbar 模块,AnimatedMarker() 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用progressbar.AnimatedMarker()

项目:deepdream-neural-style-transfer    作者:rdcolema    | 项目源码 | 文件源码
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
项目:ffpb    作者:althonos    | 项目源码 | 文件源码
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='--:--:--'
            ),
        ])