Created
May 27, 2020 17:54
-
-
Save jaymody/8252f91b490c2a0612be7dce3d8eb921 to your computer and use it in GitHub Desktop.
Resetting/fixing multiline tqdm output without having to restart a jupyter notebook.
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
# source - https://stackoverflow.com/a/61230293/11070463 | |
# | |
# Often, i'll be working in on a jupyter notebook and an error/bug will | |
# interrupt the execution of something that was wrapped with the tqdm | |
# function. This has the annoying side effect where your next tqdm call | |
# will be multilined. To fix this, you can the below two lines of code | |
# and it'll be fixed! (if tqdm gets interrupted again, you'll have the | |
# run these two lines again). | |
while len(tqdm._instances) > 0: | |
tqdm._instances.pop().close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment