首页 > 解决方案 > 使用 Python 解析具有多个 json 的文本文件

问题描述

在更新关闭时重新发布问题

{
  "schema": "2.0",
  "comp": [
    "fid1"
  ],
  "name": "Temp1",
  "type": "type1",
  "attr": {
    "version": "10.2.0.3"
  }
}

{
  "time": "18:21:58",
  "process": "Start",
  "msg": "Start"
}

我想将其解析为多个 JSON 对象。我尝试使用 json.load 但由于它不是纯 json 文件,它不起作用。其他选项是:

有没有其他方法可以解析并且即使文件大小增加也可以适应?此外,文件中的 JSON 可以不同。

标签: pythonjsonparsingjsonparser

解决方案


推荐阅读