import io from IPython.nbformat import current def execute_notebook(nbfile): with io.open(nbfile) as f: nb = current.read(f, 'json') ip = get_ipython() for cell in nb.worksheets[0].cells: if cell.cell_type != 'code': continue ip.run_cell(cell.input) figure_list = ['Figure%s.ipynb'%(i+1) for i in range(8)] + ['AppendixA-FAST', 'AppendixB', 'AppendixC'] for fig_nb in figure_list: execute_notebook(fig_nb)