Closed jwsmithers closed 4 years ago
When in a IPython environment (jupyter for example), tqdm prints a new line for each progress made. This can get quite annoying 🙂
jupyter
tqdm
The solution is to import tqdm notebook version instead: from tqdm.notebook import tqdm So maybe a check, something like from here:
from tqdm.notebook import tqdm
def isnotebook(): try: shell = get_ipython().__class__.__name__ if shell == 'ZMQInteractiveShell': return True # Jupyter notebook or qtconsole elif shell == 'TerminalInteractiveShell': return False # Terminal running IPython else: return False # Other type (?) except NameError: return False # Probably standard Python interpreter
The alternative could be just a flag: is_notebook=True.
is_notebook=True
If there's already a solution to this, great and sorry for the noise! 🙂
So, after restarting my kernel this seems to have been resolved. Not sure what happened, but awesome!
When in a IPython environment (
jupyter
for example),tqdm
prints a new line for each progress made. This can get quite annoying 🙂The solution is to import
tqdm
notebook version instead:from tqdm.notebook import tqdm
So maybe a check, something like from here:The alternative could be just a flag:
is_notebook=True
.If there's already a solution to this, great and sorry for the noise! 🙂