import json
# 读取带注释 // /* */ 的json文件
def parse_json_with_comments(file_path):
    # 指定文件编码为UTF-8
    with open(file_path, 'r', encoding="UTF-8") as f:
        lines = f.readlines()

    # 从每行中删除注释
    lines = [line.split('//')[0].strip() for line in lines]
    lines = [line for line in lines if line]

    #连接行以创建有效的JSON字符串
    json_str = ''.join(lines)

    # 加载JSON字符串
    return json.loads(json_str)