本文整理汇总了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)
示例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
示例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)
示例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()
示例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 ###