Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow saving notebook.py next to notebook.ipynb #1146

Merged
merged 3 commits into from
Dec 13, 2011

Conversation

minrk
Copy link
Member

@minrk minrk commented Dec 13, 2011

PR made at request of @fperez

This simply adds a flag for optionally saving .py version of notebooks alongside .ipynb.

enable with:

NotebookManager.save_script=True

enable with:

    NotebookManager.save_script=True
with open(pypath,'w') as f:
current.write(nb, f, u'py')
except:
raise web.HTTPError(400, u'Unexpected error while saving notebook as script')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should at least put the exception message here? I think it would both help users and us if we ever have to debug a user-side problem.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@fperez
Copy link
Member

fperez commented Dec 13, 2011

This is great; I only have one comment on the code I made inline. Otherwise, before merging I just think this feature deserves a little note in the notebook section of the docs, as it may not be noticed by users normally and can be very useful in many circumstances. If you're too swamped I can add that note before merging, let me know.

@minrk
Copy link
Member Author

minrk commented Dec 13, 2011

doc note added

@fperez
Copy link
Member

fperez commented Dec 13, 2011

Excellent, merging now.

fperez added a commit that referenced this pull request Dec 13, 2011
Allow saving notebook.py next to notebook.ipynb.  This allows notebooks to be imported or %run via their .py companion file.
@fperez fperez merged commit 1184eb4 into ipython:master Dec 13, 2011
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Allow saving notebook.py next to notebook.ipynb.  This allows notebooks to be imported or %run via their .py companion file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants