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
Seems not to be a reliable way of checking if the code is run in a notebook #155
Comments
Thanks for pointing this out! Are you aware of something that works reliably? The SO thread also seems to be somewhat split on what's the best way to do this. |
Not really, but maybe using get_ipython().class.name == 'ZMQInteractiveShell' would be better, for the time being. |
Created a PR - not sure if this is the solution we would like to go with but if that would be the case the PR is ready 🙂 |
Be careful in @mcallara 's answer |
fastai/fastai/imports.py
Line 27 in 0b831c9
@sebastianruder when I test this in my notebook cfg['IPKernelApp']['parent_appname'] returns a traitlets.config.loader.LazyConfigValue object. Please see this stackoverflow's thread. Thanks for the added feature!
ipykernel==4.8.1
ipython==6.2.1
jupyter==1.0.0
jupyter-client==5.2.2
jupyter-console==5.2.0
jupyter-contrib-core==0.3.3
jupyter-contrib-nbextensions==0.4.0
jupyter-core==4.4.0
jupyter-highlight-selected-word==0.1.0
jupyter-latex-envs==1.4.1
jupyter-nbextensions-configurator==0.4.0
The text was updated successfully, but these errors were encountered: