(json_dict, file_path, indent=4)
| 10 | return json_dict |
| 11 | |
| 12 | def save_json(json_dict, file_path, indent=4): |
| 13 | with open(file_path, mode='w', encoding='utf8') as fp: |
| 14 | try: |
| 15 | if indent == -1: |
| 16 | json.dump(json_dict, fp, ensure_ascii=False) |
| 17 | else: |
| 18 | json.dump(json_dict, fp, ensure_ascii=False, indent=indent) |
| 19 | except Exception as e: |
| 20 | if indent == -1: |
| 21 | json5.dump(json_dict, fp, ensure_ascii=False) |
| 22 | else: |
| 23 | json5.dump(json_dict, fp, ensure_ascii=False, indent=indent) |
| 24 | |
| 25 | def check_json(json_string): |
| 26 | try: |