當前位置: 首頁>>代碼示例>>Python>>正文


Python progressbar.SimpleProgress方法代碼示例

本文整理匯總了Python中progressbar.SimpleProgress方法的典型用法代碼示例。如果您正苦於以下問題:Python progressbar.SimpleProgress方法的具體用法?Python progressbar.SimpleProgress怎麽用?Python progressbar.SimpleProgress使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在progressbar的用法示例。


在下文中一共展示了progressbar.SimpleProgress方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: create_progress_bar

# 需要導入模塊: import progressbar [as 別名]
# 或者: from progressbar import SimpleProgress [as 別名]
def create_progress_bar(dynamic_msg=None):
    # Taken from Andreas Rueckle.
    # usage:
    #   bar = _create_progress_bar('loss')
    #   L = []
    #   for i in bar(iterable):
    #       ...
    #       L.append(...)
    #
    #   bar.dynamic_messages['loss'] = np.mean(L)
    widgets = [
        ' [batch ', progressbar.SimpleProgress(), '] ',
        progressbar.Bar(),
        ' (', progressbar.ETA(), ') '
    ]
    if dynamic_msg is not None:
        widgets.append(progressbar.DynamicMessage(dynamic_msg))
    return progressbar.ProgressBar(widgets=widgets) 
開發者ID:UKPLab,項目名稱:e2e-nlg-challenge-2017,代碼行數:20,代碼來源:timing.py

示例2: set_tot_elaborations

# 需要導入模塊: import progressbar [as 別名]
# 或者: from progressbar import SimpleProgress [as 別名]
def set_tot_elaborations(self, tot_elaborations):
        """
        Set the total number of elaborations

        :param tot_elaborations: total number of elaborations
        :return: None
        """

        widgets = [
            progressbar.Percentage(),
            ' (', progressbar.SimpleProgress(), ') ',

            progressbar.Bar(),
            progressbar.Timer(),
            ' ETC: ', self._ETC, ' '
        ]
        self._bar = progressbar.ProgressBar(redirect_stderr=True, max_value=tot_elaborations, widgets=widgets)
        self._bar.start()
        self._tot_elaborations = tot_elaborations 
開發者ID:ucsb-seclab,項目名稱:karonte,代碼行數:21,代碼來源:bar_logger.py

示例3: _create_progress_bar

# 需要導入模塊: import progressbar [as 別名]
# 或者: from progressbar import SimpleProgress [as 別名]
def _create_progress_bar(dynamic_msg=None):
    widgets = [
        ' [batch ', progressbar.SimpleProgress(), '] ',
        progressbar.Bar(),
        ' (', progressbar.ETA(), ') '
    ]
    if dynamic_msg is not None:
        widgets.append(progressbar.DynamicMessage(dynamic_msg))
    return progressbar.ProgressBar(widgets=widgets) 
開發者ID:UKPLab,項目名稱:iwcs2017-answer-selection,代碼行數:11,代碼來源:__init__.py

示例4: get_progress_bar

# 需要導入模塊: import progressbar [as 別名]
# 或者: from progressbar import SimpleProgress [as 別名]
def get_progress_bar(num_reads):
    bar_format = [RotatingMarker(), " ", SimpleProgress(), Bar(), Percentage(), " ", ETA()]
    progress_bar = ProgressBar(maxval=num_reads, widgets=bar_format)
    bad_progressbar_version = False
    try:
        progress_bar.currval
    except AttributeError as e:
        bad_progressbar_version = True
        pass
    if bad_progressbar_version:
        raise RuntimeError('Wrong progressbar package detected, likely '
                           '"progressbar2". Please uninstall that package and '
                           'install "progressbar33" instead.')

    return progress_bar.start() 
開發者ID:nanoporetech,項目名稱:ont_fast5_api,代碼行數:17,代碼來源:conversion_utils.py

示例5: make_widget

# 需要導入模塊: import progressbar [as 別名]
# 或者: from progressbar import SimpleProgress [as 別名]
def make_widget():
    widgets = [progressbar.Percentage(), ' ', progressbar.SimpleProgress(), ' ', 
                                 progressbar.Bar(left = '[', right = ']'), ' ', progressbar.ETA(), ' ', 
                                 progressbar.DynamicMessage('LOSS'), ' ',  progressbar.DynamicMessage('PREC'), ' ',
                                 progressbar.DynamicMessage('REC')]
    bar = progressbar.ProgressBar(widgets = widgets)
    return bar


### Find nearest timestamps ### 
開發者ID:illidanlab,項目名稱:urgent-care-comparative,代碼行數:12,代碼來源:utilities.py


注:本文中的progressbar.SimpleProgress方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。