Skip to content

Instantly share code, notes, and snippets.

@eltrujo
Created December 25, 2020 23:26
Show Gist options
  • Save eltrujo/473ac4e9ac0f915f572924f9d1ecf987 to your computer and use it in GitHub Desktop.
Save eltrujo/473ac4e9ac0f915f572924f9d1ecf987 to your computer and use it in GitHub Desktop.
Displays a progress bar in Jupyter and Colab notebooks
from IPython.display import HTML, display
def update_progress(value, max=1):
return HTML("""
<progress
value='{value}'
max='{max}',
style='width: 100%'
>
{value}
</progress>
""".format(value=value, max=max))
progress_bar = display(update_progress(0, 1), display_id=True)
for ii in range(101):
time.sleep(0.02)
progress_bar.update(update_progress(ii / 100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment