Simplejson And Random Key Value
Here is the value i got from API server {'query':{'pages':{'-1':{'ns':0,'title':'spencerx','missing':''}}}} Let say if i want to get determine if it's not missing word, i will kn
try print x['query']['pages'].keys()
, which would give you ['-1']
for the first case and ['1080152']
for the second one.
if you just want to check '-1'
in x['query']['pages']
:
if'-1'in x['query']['pages']:
# dictionary x['query']['pages'] has '-1'as a key
would suffice
You may like these posts
Post a Comment for "Simplejson And Random Key Value"