I am currently getting a very long JSON and I am trying to select 2 pieces of information from it through Python 2.7.
JSON looks something like this:
{ 'device': [ { 'serial': '00000000762c1d3c', 'registered_id': '019' }, { 'serial': '000000003ad192f2', 'registered_id': '045' }, { 'serial': '000000004c9898aa', 'registered_id': '027' } ], }
Inside this JSON, I'm looking for a specific series that can match one in JSON. If so, it should also print register_id.
I tried using a simple script, even without register_id, but I can't go anywhere .:
if '00000000762c1d3c' not in data['device']: print 'not there' else: print 'there'
Thanks for your suggestions!
source share