Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tqdm in Jupyter #33

Closed
mkhorton opened this issue Aug 21, 2018 · 4 comments
Closed

tqdm in Jupyter #33

mkhorton opened this issue Aug 21, 2018 · 4 comments

Comments

@mkhorton
Copy link
Member

Should from tqdm import tqdm_notebook as tqdm when running inside Jupyter to avoid writing a billion progress bars. I'm not sure the cleanest way to check if running inside Jupyter however -- there seem to be a few options, none of them great.

@tschaume
Copy link
Member

I've used get_ipython in the past to check for an interactive ipython (Jupyter) environment. So maybe something like the following could work here:

from IPython import get_ipython
ipython = get_ipython()
if ipython is not None:
    from tqdm import tqdm_notebook as tqdm

HTH

@mkhorton
Copy link
Member Author

get_ipython will be True even if running from ipython command line no? so it's not Jupyter specific

@mkhorton
Copy link
Member Author

The one thing I've found is get_ipython().config does return a dict with a IPKernelApp key if running inside Jupyter, but I'm not sure if that's guaranteed or not.

@dwinston
Copy link
Member

Done via #34. Thanks @mkhorton!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants