JSON 转换工具

2021-06-08 07:03

阅读:555

#!/usr/bin/env python
# coding:utf-8
a = ‘[{\"headers\":{\"topic\":\"test1\",\"key\":\"01234567891234560123456789123456\",\"timestamp\":1497583079293},\"body\":\"{\"TkeyWord\":\"安全隐患\",\"ID\":\"01234567891234560123456789123456\",\"Url\":\"技术分享http://epaper.chinatibetnews.com/xzrb/html/2017-06/16/content_773650.htm 

\",\"Title\":\"严查安全隐患\",\"Content\":\"夏季为火灾多发期。为防患于未然,最大限度地减少火灾事故的发生,提高广大群众的消防安全意识,连日来,全区各地消防部门深入各辖区在建工地、公共娱乐场所等开展消防安全专项检查,严查各类火灾隐患和消防违法行为。技术分享\\r\\n消防官兵在林芝市巴宜区检查宾馆消防应急设施。肖暄 摄技术分享\\r\\n日喀则市消防监督员对建筑工地消防器材进行安全检查。肖暄  摄\",\"Author\":null,\"From\":\"西藏日报\",\"Time\":1497542400000,\"Tag\":null,\"Images\":0,\"ImageUrl\":\"\",\"Comments\":0,\"Views\":0,\"Praises\":0,\"Place\":\"林芝 巴宜区 日喀则\",\"Person\":\"\",\"Keyword\":\"安全隐患 消防官兵 林芝 巴宜区 违法行为 消防安全 火灾事故 消防 消防器材 火灾\",\"Hash\":\"cdeef4587d88f1e4081d336a1bcea73 c756ed843f7122d365724845ff108bf9 cb78413481339c2a2a4593053632a936\",\"ParagraphHash\":\"\",\"Segment\":\"夏 夏季 季 为 火 火灾 灾 多 多发 多发期 发 为 防 防患 防患于未然 患 于 未 未然 最 最大 大 限 限度 度 地 减 减少 少 火 火灾 火灾事故 灾 事 事故 故 的 发 发生 生 提高 高 广 广大 大 大群 群 群众 众 的 消 消防 消防安全 防 安 安全 安全意识 全 意 意识 识 连 连日 连日来 日 来 全 全区 区 各 各地 地 消 消防 防 部门 门 深 深入 入 各 辖 辖区 区 在 在建 建 工 工地 地 公 公共 共 娱 娱乐 娱乐场 乐 场 场所 所 开 开展 展 消 消防 消防安全 防 安 安全 全 专项 项 检 检查 查 严 严查 查 各 各类 类 火 火灾 灾 隐 隐患 患 和 消 消防 防 违 违法 违法行为 法 行 行为 为 消 消防 消防官兵 防 官 官兵 兵 在 林 林芝 市 巴 巴宜区 宜 区 检 检查 查 宾馆 消 消防 防 应 应急 急 设施 施 肖 摄 日 日喀则 日喀则市 喀 市 消 消防 防 监 监督 监督员 督 员 对 建 建筑 筑 工 工地 地 消 消防 消防器材 防 器材 进 进行 行 安 安全 全 检 检查 查 肖 摄\",\"TitleSegment\":\"严查 安全隐患\",\"TaskID\":105662,\"TaskName\":\"西藏日报_全站采集\",\"GroupID\":105660,\"GroupName\":\"西藏日报藏文版\",\"SiteID\":0,\"Country\":0,\"Language\":2052,\"SiteType\":6,\"Channel\":8888,\"DefinedType\":0,\"DefinedSite\":\"105 678 1371 1410 1461\",\"PR\":7,\"Headline\":0,\"Overseas\":0,\"TopicID\":0,\"HotChannel\":0,\"AddOn\":1497582608000,\"CustomerID\":\"18 40 54 54 54\",\"SChannel\":0,\"SCatagory\":0,\"Continent\":0,\"Tissue\":0,\"IsTopic\":0,\"Pure\":\"ecdeef4587d88f1e4081d336a1bcea73\",\"Pureadj\":\"c756ed843f7122d365724845ff108bf9\",\"Pun\":\"\",\"Nounnum\":\"cb78413481339c2a2a4593053632a936\",\"Departments\":\"\",\"Brands\":\"\",\"Companies\":\"\",\"Domain\":\"技术分享chinatibetnews.com 

\",\"Product\":\"\",\"Work\":\"\",\"Heading\":0,\"IsVideo\":0}\"}]‘
a = a.replace(‘\"‘, ‘"‘)
import json
bb = json.loads(json.dumps(a))
print(bb)


评论


亲,登录后才可以留言!