Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
10925 Prikazi

Hello everybody!!!

Can anyone help me know how to parse this json please:

[{"action": "update", "type": "contract_info", "data": {"param": "contract_wage", "value": 2500}}, {"action": "update", "type": "contract_info", "data": {"param": "contract_day_rate", "value": 115.36686663590216}}, {"action": "update", "type": "contract_info", "data": {"param": "contract_hour_rate", "value": 14.42085832948777}}, {"action": "update", "data": {"value": "oui", "param": "family_boss_ok"}, "type": "empolyee_info"}, {"action": "update", "data": {"value": "oui", "param": "family_boss_ok"}, "type": "empolyee_info"}]

Thanks a lot in advance.

Avatar
Opusti
Avtor Best Answer

Here is the answer:

import json

with open('data.json') as f :

data = f.read()

jsondata = json.loads(data)

for count in jsondata:

print count['type']

print count['data']['param']

print count['data']['value']

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
3
feb. 25
3539
0
maj 24
46
1
apr. 24
3347
4
sep. 23
4830
2
sep. 23
7043