Python字典的json格式化处理
来源:互联网 发布:手机全包壳 知乎 编辑:程序博客网 时间:2024/06/07 11:46
Prefer = {"jim": {"War": 1.9, "the big bang": 1.0, "The lord of wings": 4.0, "Beautiful America": 4.7}, "lily": {"War": 2.0, "Kongfu": 4.1, "The lord of wings": 3.6}, "tommy": {"War": 2.3, "Kongfu": 5.0, "The lord of wings": 3.0}, "jack": {"War": 2.8, "Kongfu": 5.5, "The lord of wings": 3.5}}print('将字典一行显示不换行')print(json.dumps(Prefer))print('将字典按照json样式可视化显示')print(json.dumps(Prefer,indent=1))
显示的结果是:
将字典一行显示不换行{"jim": {"War": 1.9, "the big bang": 1.0, "The lord of wings": 4.0, "Beautiful America": 4.7}, "lily": {"War": 2.0, "Kongfu": 4.1, "The lord of wings": 3.6}, "tommy": {"War": 2.3, "Kongfu": 5.0, "The lord of wings": 3.0}, "jack": {"War": 2.8, "Kongfu": 5.5, "The lord of wings": 3.5}}将字典按照json样式可视化显示{ "jim": { "War": 1.9, "the big bang": 1.0, "The lord of wings": 4.0, "Beautiful America": 4.7 }, "lily": { "War": 2.0, "Kongfu": 4.1, "The lord of wings": 3.6 }, "tommy": { "War": 2.3, "Kongfu": 5.0, "The lord of wings": 3.0 }, "jack": { "War": 2.8, "Kongfu": 5.5, "The lord of wings": 3.5 }}
0 0
- Python字典的json格式化处理
- python字典的格式化字符串
- Python 字典的格式化转换
- Python处理json字符串转化为字典
- Python处理json字符串转化为字典
- Python处理json字符串转化为字典
- Python的字典和JSON
- Python的字典形式格式化字符
- 格式化的JSON格式的字符串转换成字典
- Python的Json处理
- IOS 把格式化的JSON字符串转换成字典
- IOS 把格式化的JSON字符串转换成字典
- IOS 把格式化的JSON字符串转换成字典
- iOS 把格式化的JSON字符串转换成字典
- IOS 把格式化的JSON字符串转换成字典
- IOS 把格式化的JSON字符串转换成字典
- IOS 把格式化的JSON字符串转换成字典
- IOS 把格式化的JSON字符串转换成字典
- 蓝桥杯-入门训练-圆的面积
- 创建github仓库后如何推送代码
- linkedList
- iOS设计模式简介
- HDU 2438 Turn the corner
- Python字典的json格式化处理
- DZNEmptyDataSet,优秀的空白页或者出错页封装
- 69. Sqrt(x)
- nginx在windows下配置反向代理
- Android 线程池 工作调度
- codeforces 614B
- android monkey测试
- 异步套接字实现
- 带大家一步一步的封装一个聊天键盘