python中的 json 模块使用
2016-05-12 12:02
567 查看
(1)python 中生成 json 字符串:
(2)python 中解析 json字符串:
import json data = dict(ret=0, msg="Welcome, Login success!") json_str = json.dumps(data, sort_keys=True) print json_str
(2)python 中解析 json字符串:
import json json_str = '{"msg": "Welcome, Login success!", "ret": 0}' data_dict = json.loads(json_str) print data_dict
相关文章推荐
- python之permutations和combinations的区别
- python之permutations和combinations的区别
- leetcode(7),Contains Duplicate(python)
- error: could not create '/Library/Python/2.7/site-packages/jedi': Permission denied
- python 查看API
- WIndwos7-64bit注册
- Python 网页解析器BeautifulSoup示例使用
- RobotFramework自动化测试框架搭建(windows)
- Python IO multiplex
- python学习手记-----函数
- python libsvm windows 64位 安装
- Python ZipFile模块功能特点讲解
- Python excel 读写操作
- python学习笔记--虫师
- Python点滴(三)—pandas数据分析与matplotlib画图
- python线程使用场景 多线程下载
- python模拟自动登录网站(urllib2)
- python list
- python map函数,filter,reduce
- Python下划线与命名规范