- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
Latest commit
18 lines (14 loc) · 545 Bytes
/
Copy pathutils.py
File metadata and controls
18 lines (14 loc) · 545 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
importjson
importos
deffile_json_loads(input_file_path):
file_obj=open(input_file_path, encoding='utf-8')
python_data_dict=json.load(file_obj)
#print(python_data_dict)
returnpython_data_dict
defjson_dict_dump_to_file(json_dict, output_file_path):
dir_path=os.path.dirname(os.path.abspath(output_file_path))
ifnotos.path.exists(dir_path):
os.makedirs(dir_path)
file_obj=open(output_file_path, mode="w", encoding='utf-8')
json.dump(json_dict, file_obj, ensure_ascii=False)
file_obj.close()