import json from typing import Dict, Any def parse_json_file(file_path: str) -> Dict[str, Any]: """ 读取并解析JSON文件为Python对象 参数: file_path: JSON文件路径 返回: 解析后的Python字典对象 """ try: with open(file_path, 'r', encoding='utf-8') as file: data = json.load(file) return data except FileNotFoundError: print(f"错误:文件 {file_path} 未找到") except json.JSONDecodeError as e: print(f"JSON解析错误:{e}") except Exception as e: print(f"发生错误:{e}")