【发布时间】:2020-02-09 05:11:16
【问题描述】:
我在 python 中使用 azure cosmos db,无法按我想要的方式打印数据。
我的容器:
{
"id": "first",
"lexicon": {
"Eqt": "UNKN",
"PN": "abvcfgg",
},
"location": {
"Region": "China",
"Country": "China"
}
}
Python 代码:
for item in list(results):
print(results)
输出是:
{'id': 'test', 'lexicon': {'Eqt': 'UNKN', 'PN': 'abvcfgg'}, "location": { "Region": "China",
"Country": "China"}
我想要的输出方式是:
id: test
Lexicon:
Eqt: UNKN
PN: abvcfgg
location
Region: China
Country: China
【问题讨论】:
-
如果您在浏览器中搜索“Python 输出教程”,您会找到比我们在此处管理的更能解释这一点的参考资料。
标签: python json azure dictionary