如何在json数据中获取“符号”数据,如下图所示?我正在使用Python
另外,如何用replace替换此数据中的“}”对象
[
{"symbol": "ZILUSDT", "positionAmt": "0", "entryPrice": "0.00000", "markPrice": "0.01728152", "unRealizedProfit": "0.00000000", "liquidationPrice": "0", "leverage": "20", "maxNotionalValue": "25000", "marginType": "cross", "isolatedMargin": "0.00000000", "isAutoAddMargin": "false", "positionSide": "SHORT"},
{"symbol": "FLMUSDT", "positionAmt": "0", "entryPrice": "0.0000", "markPrice": "0.00000000", "unRealizedProfit": "0.00000000", "liquidationPrice": "0", "leverage": "20", "maxNotionalValue": "25000", "marginType": "cross", "isolatedMargin": "0.00000000", "isAutoAddMargin": "false", "positionSide": "BOTH"},
{"symbol": "FLMUSDT", "positionAmt": "0", "entryPrice": "0.0000", "markPrice": "0.00000000", "unRealizedProfit": "0.00000000", "liquidationPrice": "0", "leverage": "20", "maxNotionalValue": "25000", "marginType": "cross", "isolatedMargin": "0.00000000", "isAutoAddMargin": "false", "positionSide": "LONG"},
{"symbol": "FLMUSDT", "positionAmt": "0", "entryPrice": "0.0000", "markPrice": "0.00000000", "unRealizedProfit": "0.00000000", "liquidationPrice": "0", "leverage": "20", "maxNotionalValue": "25000", "marginType": "cross", "isolatedMargin": "0.00000000", "isAutoAddMargin": "false", "positionSide": "SHORT"}
]
要读取json数据,请使用
json.load()
函数在将字典列表作为JSON加载后,可以对其进行迭代(假设它是
d
):可读方式:
从文件加载:
那是一份字典清单
相关问题 更多 >
编程相关推荐