I'm creating a Django tutorial in an IPython Notebook and I want to use the %save
magic to save .py
files to create / edit / advance a website as the tutorial progresses. The problem is the %save
magic works by specifying which lines to save. Undoubtedly, the line number will change when users execute the cells before the file out of order or multiple times.
I'd like to work like this:
some .py file imported into the notebook.
# do all sorts of website things
%save -f this.py file
where it would save the contents of the cell without needing the line number. Is there any way to do this with the existing functionality of the %save
magic?