File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 2
2
# -*- coding: utf-8 -*-
3
3
4
4
import glob
5
+ import json
5
6
6
7
from IPython .config import Config
8
+ from IPython .nbconvert import ExecutePreprocessor
7
9
from IPython .nbconvert import HTMLExporter
10
+ from IPython .nbformat import NotebookNode
8
11
9
12
c = Config ({
10
- 'ExecutePreprocessor' : {'enabled' : True }
13
+ 'ExecutePreprocessor' : {'enabled' : True }
11
14
})
12
15
13
16
exporter = HTMLExporter (config = c )
17
+ executor = ExecutePreprocessor (config = c )
14
18
15
19
for filename in glob .glob ("example-notebooks/*.ipynb" ):
16
- print (filename )
17
- exporter .from_filename (filename )
20
+ print (filename )
21
+ exporter .from_filename (filename )
22
+ with open (filename , 'r' ) as file :
23
+ node = NotebookNode (json .load (file ))
24
+ executor .preprocess (node , {})
You can’t perform that action at this time.
0 commit comments