I'm currently getting a very long JSON and I'm trying to pick out 2 pieces of information from it through Python 2.7.
The JSON looks roughly like this:
{
'device': [
{
'serial': '00000000762c1d3c',
'registered_id': '019'
},
{
'serial': '000000003ad192f2',
'registered_id': '045'
},
{
'serial': '000000004c9898aa',
'registered_id': '027'
}
],
}
Within this JSON I'm looking for a specific serial that might match with one in the JSON. If it does, it should print out the registered_id as well.
I've tried using a simple script, even without the registered_id but I'm getting nowhere.:
if '00000000762c1d3c' not in data['device']:
print 'not there'
else:
print 'there'
Thanks for your suggestions!