Putting default text in a new Jupyter notebook

Is there a way to open a new Jupyter block from a template? (which in itself will not be changed)

I would expect something like this:

jupyter --template <template-filename>

(reusing an existing jupyter-notebook server session, if one already exists)

But I don't seem to see how to do this (from Jupyter 4.0.6)

+4
source share
1 answer

I admit this is a pretty hacky solution, but just in case there is no implemented solution: you can make an alias in your .bashrcas follows:

alias newnb='cp -i ~/templates/jupyter.ipynb new_notebook.ipynb && juypter notebook'

Then the command newnbin your terminal copies the template file to your current directory and calls up a jupyter laptop session in this directory, where you can open new_notebook.ipynbwith this content.

0

Source: https://habr.com/ru/post/1617801/


All Articles