I have a very long and complicated json object but I only want to get the items/keys in the first level!
Example:
{
"1": "a",
"3": "b",
"8": {
"12": "c",
"25": "d"
}
}
I want to get 1,3,8 as result!
I found this code:
for key, value in data.iteritems():
print key, value
But it prints all keys (also 12 and 25)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…