File size: 368 Bytes
8cc301a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import json

# Input and output file names
input_file = "ML2.ipynb"
output_file = "ML2.json"

# Load the notebook
with open(input_file, "r", encoding="utf-8") as f:
    notebook = json.load(f)

# Save as JSON (pretty formatted)
with open(output_file, "w", encoding="utf-8") as f:
    json.dump(notebook, f, indent=4)

print("Converted successfully 💫")