字典型我有一組下面的數據:JSON進入蟒蛇
{
"dataFrame": "AB3hqqqpVVVOAAA=",
"decrypted": true,
"fcnt": 3,
"id": 1480528200533,
"port": 5,
"rssi": -116,
"sf_used": 10,
"snr": -8.5,
"timestamp": "2016-11-30T17:50:00.533Z"
},
{
"dataFrame": "AB3hqqqpVVVOAAA=",
"decrypted": true,
"fcnt": 5,
"id": 1480528235613,
"port": 5,
"rssi": -119,
"sf_used": 10,
"snr": -5.8,
"timestamp": "2016-11-30T17:50:35.613Z"
},
{
"dataFrame": "AB7hqqqpVVVOAAA=",
"decrypted": true,
"fcnt": 7,
"id": 1480528310609,
"port": 5,
"rssi": -120,
"sf_used": 10,
"snr": -8.8,
"timestamp": "2016-11-30T17:51:50.609Z"
},
{
"dataFrame": "AB7hqqqpVVVOAAA=",
"decrypted": true,
"fcnt": 9,
"id": 1480528403504,
"port": 5,
"rssi": -116,
"sf_used": 10,
"snr": -9.2,
"timestamp": "2016-11-30T17:53:23.504Z"
},
我想上述轉換成字典類型:
{
u'dataFrame': 'AB3hqqqpVVVOAAA=',
u'decrypted': true,
u'fcnt': 3,
u'id': 1480528200533,
u'port': 5,
u'rssi': -116,
u'sf_used': 10,
u'snr': -8.5,
u'timestamp': '2016-11-30T17:50:00.533Z'
}
所以,當我嘗試使用INFILE = JSON .load(infile)infile是我的輸入文件,爲什麼我會像ValueError那樣出錯:額外的數據?