【发布时间】:2021-01-12 16:20:11
【问题描述】:
我有一个 json 响应
{"length": 2, "chain": [{"index": 0, "transactions": [], "timestamp": 0, "previous_hash": "0", "nonce": 0, "hash": "6dbf23122cb5046cc5c0c1b245c75f8e43c59ca8ffeac292715e5078e631d0c9"}, {"index"
: 1, "transactions": [{"test": "test2.m4a", "ipfs_hash": "QmaQgbSbgZdAfdiHmnfD9PevwpYSepytvA5G6agupqjVA3", "timestamp": 1610467381.102983, "Mac_ADD": "e0:94:67:bc:17:f9", "signature": "b'AQAgIQgAAD'"}], "timestamp":1610467386.9993732,"previous_hash":"6dbf23122cb5046cc5c0c1b245c75f8e43c59ca8ffeac292715e5078e631d0c9", "nonce": 214, "hash": "00a92715e60f577a57165b52c02e2b6bbef1ba60a3a27ead16e4d6a7a0a9d3d2"}], "peers": []}
我想使用“test”值找到对应的“ipfs_hash”。如何在 python 中实现这一点?
【问题讨论】:
-
您好,您应该在此处发布您已经开发的代码,以便人们可以提供帮助 - Python 的起点是使用 json.loads 解析 JSON 字符串。
标签: python json list dictionary