76 ms·
I found a good compromise by using VSCode Python extension. You can import Jupyter notebooks as Python scripts and the other way around [0]. If I need to work o
by morotter 7y ago
I found a good compromise by using VSCode Python extension. You can import Jupyter notebooks as Python scripts and the other way around [0]. If I need to work on a notebook, I prefer working with a Python script and the interactive window [1]. Then I commit both script and ipynb version.
[0] https://code.visualstudio.com/docs/python/jupyter-support-py#_export-a-jupyter-notebook https://code.visualstudio.com/docs/python/jupyter-support-py...
[1] https://code.visualstudio.com/docs/python/jupyter-support-py#_python-interactive-window https://code.visualstudio.com/docs/python/jupyter-support-py...
- bobbylarrybobby 7y agoAgree 100%. Only thing I’d add is that the killer feature of the extension is that it allows one to treat ordinary python files as notebooks (without converting!) by 1. Connecting to a persistent kernel instance 2. Allowing the user to use magic comments to delineate code cells within the python file. With these two things, and the ability to export as a real notebook, you get the great experience of a notebook — submitting easily editable cells to a kernel one at a time, as many times as you want — without of all the usual baggage that that would entail. Plus you get to edit in a decent editor (and edit things other than just python files in it) instead of the crap Jupyter forces you to use.
- Tarq0n 7y agoVSCode's solution is awesome. Rmarkdown works the same way, and it makes a lot of sense. Let code live as plaintext, it's native format, and only render results at runtime. Trying to preserve results in the file just makes things needlessly stateful.