0
我有這種格式的日誌文件,分析數據轉化爲JSON文件
{
"box1" : {
"item1" : "testValue1",
"item2" : "testValue2"
},
"foods" : [
{
"orange" : "per pound",
"price" : 2.99
},
{
"rice" : "in bag",
"price" : 1.99
"extra-key" : "extra-Value",
"extra-key2" : "extra-Value2",
},
{
"beer" : "in box",
"price" : 12.99
"extra-key3" : "extra-Value3"
"content" : None
}
]
}
,我想下面的值提取到了一個Python輸出文件:
[ "orange" : "per pound", "rice" : "in bag","beer" : "in box" ]
可有人表演我如何做到這一點?