Skip to content

Instantly share code, notes, and snippets.

@ant1441
ant1441 / execute_and_save.py
Last active January 3, 2016 06:19 — forked from jonathan-taylor/execute_and_save.py
Python script to load, execute and save an IPython notebook. Handles slow running cells, with a defined time out. Developed under IPython version 1.1.0.
"""
simple example script for running notebooks and saving the resulting notebook.
Usage: `execute_and_save.py foo.ipynb [bar.ipynb [...]]`
Each cell is submitted to the kernel, and the outputs are overwritten and
stored in new notebooks foo_executed.ipynb, etc.
See IPython messaging protocol
http://ipython.org/ipython-doc/stable/development/messaging.html