Spaces:
Sleeping
Sleeping
run first code block of app.ipynb
Browse files
app.py
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
-
import
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
1 |
+
import json
|
2 |
|
3 |
+
if __name__ == '__main__':
|
4 |
+
"""Execute the first code block of the app.ipynb notebook."""
|
5 |
+
with open('app.ipynb', 'r') as notebook:
|
6 |
+
nb = json.load(notebook)
|
7 |
+
idxs = [idx for idx, cell in enumerate(nb['cells']) if cell['cell_type']=='code']
|
8 |
+
exec(''.join(nb['cells'][idxs[0]]['source']))
|