python中 将字符串和字典的相互转换
2017-08-04 09:11
190 查看
1.首先引入json模块
2.转换
# 引入json模块 import json
2.转换
#JSON到字典转化: dictinfo = json.loads(json_str) # 输出dict类型
字典到JSON转化: jsoninfo = json.dumps(dict) # 输出str类型
相关文章推荐
- python中列表,元组,字典,字符串相互转换
- python列表,元组,字典和字符串之间的相互转换
- python json字符串与字典对象相互转换
- python 中list(列表),tupe(元组),str(字符串),dict(字典)之间的相互转换
- python 字符串,列表,元组,字典相互转换
- python实现字典(dict)和字符串(string)的相互转换方法
- python字符串列表字典相互转换
- Python中实现字符串类型与字典类型相互转换的方法
- Python中实现字符串类型与字典类型相互转换的方法
- python 字符串,列表,元组,字典相互转换
- python字符串、列表、字典相互转换
- python基础数据结构——列表(list), 元祖(tuple), 字典(dict), 字符串(string), 集合(set) 介绍及相互转换
- python基础学习——列表(list), 元祖(tuple), 字典(dict), 字符串(string), 集合(set) 介绍及相互转换
- Python中时间戳与时间字符串相互转换
- 收集: python中列表,元组,字符串 相互转换, IO 数据处理,行数据切割
- 字典对象与Json字符串相互转换
- python中字符串和字典类型互相转换
- python时间戳于时间格式字符串相互转换的方法
- python中将字典转换成其json字符串
- python xml与字典的相互转换