根据环境选择多个后端的Smart ProgressBar
smart-progress的Python项目详细描述
具有多个后端的智能progressbar支持显式更新和tqdm样式的iterable包装
用法
progressbar(iterable=None,length=None,label=None,show_eta=True,show_percent=None,show_pos=False,item_show_func=None,...,info_sep=' ',...)
有关参数和详细信息,请检查click.progressbar。到目前为止,ipython后端忽略了所有与条形图和终端相关的参数。(上面未列出的)
示例
fromsmart_progressimportprogressbarwithprogressbar([1,2,3])asbar:foriteminbar:do_work(item)
或
con=connection(...)withcon,progressbar(length=con.tot_size())asbar:whilenotcon.is_eof():block=con.retrieve_block()do_work(block)bar.update(len(block))
依赖关系
click5.x
(或者回到ipython 3.x)