File size: 173 Bytes
38e555d
 
 
 
1
2
3
4
5
from pathlib import Path
import json
def write_json(path,data):
    path=Path(path);path.parent.mkdir(parents=True,exist_ok=True);path.write_text(json.dumps(data,indent=2))