在执行以下python代码时出错:
import json
json_str = """
{
“AircraftKey”: “AircraftKey_data”,
“Latitude”: 100,
“Longitude”: 200,
“FuelQuantityLeft”: “FuelQuantityLeft_data”,
“FuelQuantityRight”: “FuelQuantityRight_data”,
“TKSLeft”: “TKSLeft_data”,
“TKSRight”: “TKSRight_data”,
“OxygenQuantity”: “OxygenQuantity_data”,
“OilTemperature”: “OilTemperature_data”,
“Battery1Voltage”: “Battery1Voltage_data”,
“Battery2Voltage”: “Battery2Voltage_data”,
“ReceivedDate”: 20190901,
“LastUpdatedDate”: 20190901
}"""
data = json.loads(json_str)
答案 0 :(得分:0)
在json.loads
之前添加以下行:
json_str = json_str.replace('“', '"').replace('”', '"')