我有一個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