Hi there,
I'm a beginner so this problem might be very ease to solve.
Im doing a request to a device that responds with the following raw data:
I had the problem before and could solve it using this method:
I think it has to do with a different format of the raw data, because all my other raw data that I can put into a variable using the explained method is not
I hope some of you can help me...
Best,
Leo
I'm a beginner so this problem might be very ease to solve.
Im doing a request to a device that responds with the following raw data:
[{u'address': {u'altitude': None, u'area': u'', u'buildingNumber': None, u'country': None, u'latitude': None, u'longitude': None, u'street': u'', u'zip': u''}, u'id': 63XXXX, u'levelOfAccess': None, u'name': u'Schuppen', u'siteKey': u'YBCL-HXXX'}]I basically want to save the value of
'siteKey'
, meaning YBCL-HXXX
into a variable.I had the problem before and could solve it using this method:
variableX = exampledata['siteKey']With this method I get the following error:
TypeError: list indices must be integers, not str
I think it has to do with a different format of the raw data, because all my other raw data that I can put into a variable using the explained method is not
[....]
but only in {....}
I hope some of you can help me...
Best,
Leo