Jupyter笔记本的Lightweigth ProgressBar
nbprogress的Python项目详细描述
nbprogress公司
用于Jupyter笔记本的ProgressBar打包为PIP包。(参考号:https://github.com/kuk/log-progress)
通过运行启用ipythonwidgets很重要
jupyter nbextension enable --py widgetsnbextension
对于Jupyterlab
jupyter labextension install @jupyter-widgets/jupyterlab-manager
使用:
pip install nbprogress
importtimeimportnbprogressforiinnbprogress.log(range(1,10),every=1):time.sleep(1)
importosimportglobimporttimeimportnbprogressinput_dir=os.getcwd()files=glob.glob(os.path.join(input_dir,'*'))forfileinnbprogress.log(enumerate(files),every=1,size=len(files)):time.sleep(1)