wag-services-and-backend-la.../Commons/json_functions.py

14 lines
304 B
Python

import os
import json
def read_json_file(json_file_path):
if os.path.exists(json_file_path):
with open(json_file_path, "r") as json_file:
return json.load(json_file)
return {}
def write_json_file(json_file_path, data):
json.dump(obj=data, fp=json_file_path, indent=2)