You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
539 B

import json
import os
def read_json_file(file_path):
json_file_path = os.path.dirname(os.path.dirname(__file__))+'/'+file_path
with open(json_file_path, 'r') as json_file:
json_data = json.load(json_file)
json_file.close()
return json_data
def write_json_file(file_path, json_data):
json_file_path = os.path.dirname(os.path.dirname(__file__))+'/'+file_path
with open(json_file_path, 'w') as updated_json:
updated_json.write(json.dumps(json_data, indent=4))
updated_json.close()