Reputation: 41725
I've seen some applauses for org-babel in place of jupyter (https://news.ycombinator.com/item?id=16842786) and trying out what it is about.
I'd like to convert *.ipynb file to *.org file and the execute each source block in org mode as we would do in jupyter notebook.
(I tried ein
couple of days, but it seems unstable)
I've succeeded converting file formats as illustrated in https://www.reddit.com/r/emacs/comments/7lcgkz/import_a_jupyter_notebook_to_an_orgmode_file/
However I'm having hard time executing code blocks because variables are not shared among code blocks.
Can I use PROPERTIES:
or similar method to run them in the same context?
Can I use ipython?
I failed to google how to use org mode for ipynb file (as I try to do).
Would like to know if someone shares a work process of doing it
Upvotes: 3
Views: 1344
Reputation: 111
If variables are not shared between code blocks it might be due to the lack of :session
argument otherwise each code block is run in standalone mode. For instance, the second block should print i
#+begin_src python :session my_session
i = 0
#+end_src
#+begin_src python :session my_session :results output
print(i)
#+end_src
whereas this one should raised a NameError: name 'i' is not defined
error
#+begin_src python :results output
print(i)
#+end_src
Upvotes: 1