-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Knowing if ipynb is run from Jupyter or nbconvert #2587
Comments
Sorry, by design there isn't - we expect nbconvert to produce similar results whether it's using saved outputs in the notebook, or generating new outputs by re-executing it. If you're using nbconvert as part of a pipeline you control, you could set an environment variable and check it in your code to switch behaviour. |
Can't I get some info by executing some javascript to get the page URL for instance ? |
Not very reliably, because of the asynchronous nature of Javascript. |
would it be bad for nbconvert to set this environment variable itself? That would be convenient. |
Agree with @JarnoRFB here - whilst I appreciate the design philosophy of having nbconvert indistinguishable from jupyter, in practice, when |
Is the above still true, or is there a better way to detect when |
Hello,
Is there a way to detect from a notebook cell whether the code is being run from a jupyter notebook or from a nbconvert command.
I would like to decide how to render some graphics based on this flag
Thanks in advance for your help,
Loic
The text was updated successfully, but these errors were encountered: