7

How do I set my IPython Notebook so that whenever I save the .ipynb file it will also automatically save the file as a .py file (in the same directory)?

In particular every time I make a change to a notebook I don't want to have to download the file as a .py file and then move the downloaded file into the directory.

I recently moved to a Mac and was able to do this on my previous (PC) setup, but haven't been able to find how to explicitly set IPython to do this.

2
  • how did you do it on your PC setup? Commented Dec 19, 2013 at 20:10
  • I don't remember as it was several years ago. Commented Dec 19, 2013 at 20:26

1 Answer 1

5

You can start the notebook server with a --script flag, or set this variable to True in the file ipython_notebook_config.py:

c.FileNotebookManager.save_script = True
Sign up to request clarification or add additional context in comments.

2 Comments

I might need to add c = get_config() beforehand in the config file
I think the config files are created with that line at the top, but if they're not, yes, you'll need to add it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.