python json 按照输出顺序 loads输出
2015-12-09 09:37
681 查看
import json from collections import OrderedDict metadata = json.loads(text, object_pairs_hook=OrderedDict); metadata中properties的顺序是跟text中定义的顺序是一样的。 具体可以看python文档中json.loads函数中的参数
相关文章推荐
- WINDOS下用EASY_INSTALL,PIP安装PYTHON第三方库
- [python] 专题八.多线程编程之thread和threading
- LeetCode OJ 系列之151 Reverse Words in a String --Python
- LeetCode OJ 系列之165 Compare Version Numbers --Python
- LeetCode OJ 系列之75 Sort Colors --Python
- LeetCode OJ 系列之58 Length of Last Word --Python
- LeetCode OJ 系列之65 Valid Number --Python
- LeetCode OJ 系列之66 Plus One --Python
- LeetCode OJ 系列之73 Set Matrix Zeroes --Python
- LeetCode OJ 系列之118 Pascal's Triangle --Python
- python常见注意事项
- Python 实现pagerank
- Python异常
- windows下安装python包管理器pip
- python条件、循环和其他语法
- python时间戳转换
- openstack,rf,python杂记
- Python 多进程开发与多线程开发
- Python 多进程开发与多线程开发
- windows下安装ipython说明