我有,看起來像檢索鍵,JSON數據蟒蛇的價值
{"tvs": 92, "sofas": 31, "chairs": 27, "cpus": 007}
我試圖環雖然字典並打印其相應價值的關鍵,在我的代碼字典的JSON文件獲得太多值來解開錯誤。
with open('myfile.json', "r") as myfile:
json_data = json.load(myfile)
for e, v in json_data:
for key, value in e.iteritem():
print key, value