我有一个JSON文件,如下所示:
{"-Kh8M0qTdXJ-vBXr1G8v":{"email":"maad@yahoo.com","user":"amad"},"-Kh8M0v7KubmISGYrzks":{"email":"maad@yahoo.com","user":"amad"},"-KhB5OYsWias6j4Mc-pX":{"email":"faraz@yahoo.com","user":"faraz"},"-KhBBZ5Ii6kHPoUFhbj8":{"email":"zeeshan@gmail.com","user":"zeeshan"},"-KhBDTyGM9LaojajmtQv":{"email":"Ali@gmail.com","user":"Ali"}}
我想打印所有电子邮件和用户值。任何人都可以帮忙,我如何使用python从JSON获取这些值?
答案 0 :(得分:0)
for d in json_dict.values():
print(d['user'], ':', d['email'])
json_dict
是你得到的json文件