4 ms·
I like the idea of executable cells for developing. It's been a couple of years since I played around with Jupyter notebooks, but then I got frustrated quite s
by maus42 10y ago
I like the idea of executable cells for developing.
It's been a couple of years since I played around with Jupyter notebooks, but then I got frustrated quite soon:
Stepping outside my preferred editor (vim) was annoying, likewise I had no idea if (how?) I could export the code out of notebook to a regular .py text file (without clumsily copypasting each cell). And the .ipynb files itself seem quite terrible to manage in Git: write something and if you want to 'git diff' the changes, sometimes what you see is okay, sometimes it's not very... easily decipherable. (Text encoded image/png's?!)
My preferred workflow with R is to open the files I'm working with in both RStudio (with vim keybindings) and vim.
Maybe if I just strictly restricted the use of notebook cells just for calling scripts and functions written in external files, and use the notebook as a whole just for presentation purposes, but then it wouldn't be that much an improvement over regular IPython. Any thoughts?
- j2kun 10y agoThere's a one-line terminal command to convert to. It's like `jupyter nbconvert -o python` or something. Works okay out of the box, and has some meager customizability.
- takluyver 10y agoYep, it's 'jupyter nbconvert --to python'. Docs here: http://nbconvert.readthedocs.io/ http://nbconvert.readthedocs.io/ It actually has a lot of customisability if you're willing to get into Jinja templates.
- denfromufa 10y agoNotebook provides keyboard shortcuts also accessible and searchable from command palette. There is also ipymd to write notebook from your editor using markdown. Pycharm supports notebooks and maybe you can use IdeaVim? You can export notebook to .py file from file menu. For git, just don't save the output, which can be removed from cells menu. See ipywidgets repo for notebook examples without outputs.