#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2024/5/23 5:43 # @Author : Tim-Saijun https://zair.top # @File : phase_json.py # @Project : SAgent import json def json_loads(json_str): try: return json.loads(json_str) except Exception as e: return None if __name__ == '__main__': import pathlib with open(pathlib.Path('data/111.json'), 'r', encoding='utf-8') as f: json_str = f.read() res = json_loads(json_str) print(type(res)) print(res[0].keys())