4 ms·
I feel like being able to import notebooks like `import notebook_name` and run jupyter notebooks (more easily) like `python notebook.ipynb` and the analogue in
by make3 1y ago
I feel like being able to import notebooks like `import notebook_name` and run jupyter notebooks (more easily) like `python notebook.ipynb` and the analogue in different languages would already get us 99% of the way there
- jedimastert 1y agoThere's a pretty direct line between the concept of notebooks and literate programming.
- audiodude 1y agoIs there any intrinsic reason why Jupyter Notebooks can't be imported? You don't know which code blocks to run?
- make3 1y agonot really, you can just run the blocks one by one like `nbconvert --to script` does. Looks like https://pypi.org/project/importnb/ https://pypi.org/project/importnb/ exists
- jdranczewski 1y agoI use jupytext https://jupytext.readthedocs.io/en/latest/ https://jupytext.readthedocs.io/en/latest/ for pretty much all of my Notebooks, which saves them as Python files. The most immediate benefits for me are easier inspection and searching of the code in any text editor, and infinitely nicer version control. But it does also let you run and import the Notebook as if it was a Python script! While writing my thesis I have also been experimenting with a Spyder-like workflow in VS Code, where you put in "# %%" to separate code blocks and get to run them in an IPython console. It had its perks, like the better Intellisense, and also resulted in this mix of interactivity and runnable file. Not as good on the markup front though.