data = [
{
"LocationId": 1, "BlastHole":
[
{
"Coords":
{
"X": 15599.1298828125, "Y": 35847.578125, "Z": 180.10580444335938
},
"DesignMass": 835.0,
"AdditionalCharge": 0.0,
"RealAdditionalMass": 0.0,
"DesignHeight": 9.992707,
"RealMass": 1301.0,
"DesignExplosiveId": 8,
"RealHeight": 15.56948,
"RealExplosiveId": 8,
"Depth": 10.0,
"SourceHoleDepth": 17.10579,
"Tamping": 0.0,
"StatusId": 4,
"UnitId": 4062,
"StaffId": 1019,
"SecondStaffId": -1,
"ShiftId": 1,
"Diameter": 0.311,
"StartTimestamp": "2020-08-18T08:46:39",
"EndTimeStamp": "2020-08-18T08:47:16",
"HoleNotes": "null",
"HoseLength": 0.0,
"BlockID": 14999,
"ID": 717689,
"Name": "100",
"OldName": "null"
}
]
}
]
for i in data:
print('BlastHole', i['BlastHole'])
if i['BlastHole']['Name'] == '100':
print(['BlastHole']['SecondStaffId'])
i['BlastHole'][0]['Name']
единственный. Каких строк может быть много? Пройтись еще одним циклом по списку?
json.dump(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, sort_keys=False, **kw)