I am trying to create / update a dictionary. I have aliases as keys in temp_dict and search for identifiers to add.
Excerpt from my code. I think you just need to see my mistake.
d1 = {u'status': u'ok', u'count': 1, u'data': [{u'nickname': u'45sss', u'account_id': 553472}]} temp_dict = {} for key, value in d1.iteritems(): if "data" == key: for dic2 in value: x = dic2['nickname'] y = dic2['account_id'] temp_dict[x] = y;
My mistake:
Traceback (most recent call last): File "untitled.py", line 36, in <module> get_PlayerIds_Names_WowpApi_TJ_()
There are several SO records regarding the same error. But none of them are related to such dictionary manipulations.
python dictionary
Aidis
source share