Parse JSON into ordered data-structure (in python)
来源:互联网 发布:乖戾知乎 编辑:程序博客网 时间:2024/06/05 22:31
From 点击打开链接
In many cases it is essential (or at the least nicer) to preserve key order from a parsed JSON document, here is how to do it in python (using the std lib json
module and OrderedDict
available in python 2.7+
)
from collections import OrderedDictimport jsonr = json.load(open('file.json'), object_pairs_hook=OrderedDict)print json.dumps(r, indent=2)
0 0
- Parse JSON into ordered data-structure (in python)
- data structure in python
- How to parse / read JSON data into a Android ListView
- parse json into string from http response in java
- data structure in PCL
- Post Json Data by Ajax, and Parse the Json Data in backend
- Python data structure
- python data structure
- import CSV data into MySQL via PyMySQL in Python 3.3
- parse json with python
- Web and php parse json data
- pyTree(tree structure in python )
- Python 3.3 Tutorial Notes - 3:Data Structure
- [Python for Data Analysis]Python Basic2--Data Structure and Sequences
- How to parse JSON in Java
- How to store a 1D table data into a general data structure?
- Data Structure
- Data structure
- 使用git从Coding.net上同步代码到Eclipse报错 Internal error; consult Eclipse error log
- 二十二、图文混合排版
- (五)2.3 查看索引使用情况
- leetcode 手机九宫格输入字母组合
- 利用redis + lua解决抢红包高并发的问题
- Parse JSON into ordered data-structure (in python)
- php完全手册中文版本
- 字符串
- linux环境常用配置
- (四)2.2 mysql 数据库对象优化之--优化索引
- 畅通工程
- Servlet/jsp拾遗
- 2016MUTC9-1010 Jong Hyok and String
- Matlab问答day12