We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80f4f56 commit c05a84aCopy full SHA for c05a84a
tools/fix_kernelspec.py
@@ -0,0 +1,19 @@
1
+import os
2
+
3
+import nbformat
4
5
+from generate_contents import iter_notebooks, NOTEBOOK_DIR
6
7
+def fix_kernelspec():
8
+ for nb_name in iter_notebooks():
9
+ nb_file = os.path.join(NOTEBOOK_DIR, nb_name)
10
+ nb = nbformat.read(nb_file, as_version=4)
11
12
+ print("- Updating kernelspec for {0}".format(nb_name))
13
+ nb['metadata']['kernelspec']['display_name'] = 'Python 3'
14
15
+ nbformat.write(nb, nb_file)
16
17
18
+if __name__ == '__main__':
19
+ fix_kernelspec()
0 commit comments