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

Possible example of how to import code from other notebook #18

Open
gneusch opened this issue Jun 30, 2020 · 1 comment
Open

Possible example of how to import code from other notebook #18

gneusch opened this issue Jun 30, 2020 · 1 comment

Comments

@gneusch
Copy link

gneusch commented Jun 30, 2020

Hello,
Thank you very much for your work, enthusiasm and effort! Could you please add an example, how it is possible to import an object from another Jupyter Notebook? If it is possible at all. I tried:
from OtherNotebook import MyObject._
But from is not a valid keyword, and I can't find any other possible keyword, that can do this trick.
Thanks a lot in advance!
Lori

@alexarchambault
Copy link
Member

@gneusch Importing a notebook from another one isn't possible at the moment. Ammonite, that almond relies on, allows importing other scripts, so that you can import Ammonite scripts (*.sc files) from notebooks. We would need to have Ammonite understand *.ipynb files too, in order to allow importing notebooks. It's not supported for now.

Maybe this could be added directly in Ammonite, or we could have Ammonite accept some kind of hooks, so that other formats could be supported, and almond could add the right hooks for *.ipynb files.

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