def iterator_progress_bar(iterator, maxval=None):
""" Returns an iterator for an iterator that renders a progress bar with a
countdown timer. """
from progressbar import ProgressBar, SimpleProgress, Bar, ETA
pbar = ProgressBar(
maxval=maxval,
widgets=[SimpleProgress(sep='/'), ' ', Bar(), ' ', ETA()],
)
return pbar(iterator)
评论列表
文章目录