You can clone with
HTTPS or Subversion.
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? If not, does anyone else have a need for such a feature?
The notebook is for editing notebooks - if you want to export a notebook to a Python script, that is already provided by the 'save as .py' facility of the notebook.
I don't want to save the entire notebook. Just certain.py files I've loaded in with %loadpy. You can see a rough example of what I mean here on line 39 in the notebook.
With this kind of feature you would be able to interactively develop and manage your projects from the same place.
Ah, I thnk get it. So basically you want to open/edit/save whole scripts from the notebook UI? We do plan to add that before too long.
Exactly. Is there any current work on it? I'd like to contribute.
There was a full-page ACE tested a while ago, and something similar will probably come in, but it will have to be done after IPEP 16.
For now, the closest equivalent workflow is to load a cell with %load, and then write it again with %%writefile filename.py
%%writefile filename.py works perfectly and saves everything in the cell. How can I update the documentation to reflect this? Thanks a lot for your help!