Skip to content

Latest commit

 

History

History
55 lines (33 loc) · 1.58 KB

Jupyter_Notebooks_Save_file_ipynb.md

File metadata and controls

55 lines (33 loc) · 1.58 KB



Template request | Bug report | Generate Data Product

Tags: #jupyternotebooks #naas #jupyter-notebooks #save #snippet #operations

Author: Florent Ravenel

Description: This notebook allows users to save their work in an interactive, web-based format (.ipynb).

Input

Import libraries

import json
from pprint import pprint

Variables

# Input
notebook_path = "../template.ipynb"

# Output
notebook_output = "new_template.ipynb"

Model

Open file

with open(notebook_path) as f:
    nb = json.load(f)

Save file

with open(notebook_output, "w") as f:
    json.dump(nb, f)

Output

Display result

pprint(nb)