Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
nbconvert Python exporter example
import nbformat
from nbconvert import PythonExporter
exporter = PythonExporter()
(source, meta) = exporter.from_filename('something.ipynb')
# When NB object is used.
#with open('something.ipynb', 'r') as infile:
#nb = nbformat.reads(, nbformat.NO_CONVERT)
#(source, meta) = exporter.from_notebook_node(nb)
with open('','w') as outfile:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment