The excellent ipython notebook has a handy --script
command line flag that automatically saves a copy of the notebook as a .py
script file (removin
Better yet (at least for my purposes): ipython respects local copies of the ipython_notebook_config.py
file. So I can just add
c = get_config()
c.NotebookManager.save_script = True
to such a file in my notebook directory. Apparently, ipython first reads ~/.ipython/profile_default/ipython_notebook_config.py
, and then reads the local copy of that file. So it's safe to use without worrying about demolishing the user settings.
This was not at all clear to me from the documentation, but I just tried it and it worked.