[IPython-User] feature request : auto save ipython notebook file
Thu Mar 22 18:05:27 CDT 2012
On Thu, Mar 22, 2012 at 3:44 PM, Brian Granger <email@example.com> wrote:
> We are working on this one.
But note that what we're discussing is a *background* autosave, that
would save the notebook with a *different* filename than the real one,
to be used only in case of a crash. What the OP is asking for is an
autosave that automatically saves the notebook he is working on
directly, and that's something I've said multiple times I absolutely
will not have on by default, because it risks saving a state that may
be unwanted. Since we have no undo/history capability, this would be
Fortunately, the OP can have autosave right now, just put this in your
"""Autosave the notebook every interval (in minutes)"""
interval *= 60*1000 # JS wants intervals in miliseconds
tpl = 'setInterval ( "IPython.notebook.save_notebook()", %i );'
and call it anywhere in your notebook to activate it.
Alternately, just put this (in this case, using 5 minutes):
setInterval ( "IPython.notebook.save_notebook()", 5*60*1000 );
in the first cell of your notebook and make it a markdown cell.
You're done, autosave is on for that notebook everytime you open it.
Remember: you have full access to the notebook 'application' itself
with a UI element ourselves, it's likely just a few lines of code away
More information about the IPython-User