我有一个json,如下所示。我只是想在关键的“活动”中添加一部分方括号。但是对于这种python编码来说,这是新的,所以我没有得到任何方法来使用python在JSON中为特定组件插入方括号。使用python在json中添加方括号
{
"name": "CopyPipeline-rdc",
"properties": {
"end": "2017-02-14T00:00:00Z",
"start": "2017-02-14T00:00:00Z",
"activities": {
"name": "CopyActivity-0",
"type": "Copy",
"input": {
"name": "InputDataset-rdc"
},
"output": {
"name": "OutputDataset-rdc"
},
"policy": {
"retry": 0,
"timeout": "00:00:00",
"concurrency": 1,
"executionpriorityorder": "OldestFirst"
},
"scheduler": {
"style": "StartOfInterval",
"interval": "1",
"frequency": "Day"
},
"typeproperties": {
"source": {
"type": "BlobSource",
"recursive": false
},
"sink": {
"type": "BlobSink",
"writeBatchSize": 0,
"writeBatchTimeout": "00:00:00"
}
}
},
"expiration": "15.00:00:00",
"description": "''",
"pipelinemode": "OneTime"
}
}
你尝试过这么远吗? –
我不确定这是一个错误。 '数据= json.loads(query_result) 为活性数据[ '名称']: \t为键在列表(response.keys()): \t \t活性关键] =名[键]' – Arjun