Created
December 25, 2020 23:26
-
-
Save eltrujo/473ac4e9ac0f915f572924f9d1ecf987 to your computer and use it in GitHub Desktop.
Displays a progress bar in Jupyter and Colab notebooks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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