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

How retrieve current notebook file name #17

Closed
pditommaso opened this issue Dec 5, 2018 · 2 comments
Closed

How retrieve current notebook file name #17

pditommaso opened this issue Dec 5, 2018 · 2 comments

Comments

@pditommaso
Copy link

pditommaso commented Dec 5, 2018

How to retrieve from the kernel the current notebook file name (and path)?

@SpencerPark
Copy link
Owner

Hi @pditommaso, this is not something you can do with the protocol. The kernel is meant to be frontend agnostic and as such has no idea what notebook it is running in (or even if it is running in a notebook). The kernel could also potentially be on a different machine that the notebook entirely!

You may be able to set up a comm and notebook extension if absolutely necessary but I don't believe it should be. What is the end goal you are trying to achieve with this information?

Also note that the current working directory of the kernel is usually set to the notebook that triggered jupyter to spawn the kernel but you shouldn't rely on this behavior.

@pditommaso
Copy link
Author

Thanks for your comment and sorry for the late reply. The notebook name it would have been useful in in the kernel integration I'm exploring but I understand your points about the protocol abstraction.

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

2 participants