sukiboo's picture
run first code block of app.ipynb
349f8b3
raw
history blame contribute delete
320 Bytes
import json
if __name__ == '__main__':
"""Execute the first code block of the app.ipynb notebook."""
with open('app.ipynb', 'r') as notebook:
nb = json.load(notebook)
idxs = [idx for idx, cell in enumerate(nb['cells']) if cell['cell_type']=='code']
exec(''.join(nb['cells'][idxs[0]]['source']))