python string 转dict
来源:互联网 发布:大数据视频 百度云盘 编辑:程序博客网 时间:2024/05/30 23:03
# -*- coding: utf-8 -*-import astimport jsonstrjson = '{"host":"192.168.1.1", "port":3306}'# 方式一: string 转 dictresjson = ast.literal_eval(strjson)print type(strjson)print type(resjson)# 方式二: string 转 dictresjson2 = eval(strjson)print type(strjson)print type(resjson2)# 方式三: string 转 dictresjson3 = json.loads(strjson)print type(strjson)print type(resjson3)
0 0
- python string 转dict
- Python:list、dict、string
- [转]Python Dict 用法
- python str转dict
- python dict转xml
- python str转dict
- python string转为dict --- json.loads
- python中的list、dict、string基本操作
- Python笔记--String、list、dict排序
- Python之list,string,tuple,dict练习题
- 转--Python 列表(list)、字典(dict)、字符串(string)常用基本操作小结
- python 中Dict 转 Json
- python两个list转dict
- Python中model转dict
- python json 转 dict , list
- python dict
- python dict
- python dict
- JS语法
- BCH and Hamming Codes
- (一)深入数组--内存中的数组
- 列表初始化
- mac终端切换用户
- python string 转dict
- 并查集 File Transfer
- c++第四次作业
- java调用python函数
- JSP
- SpannableString与SpannableStringBuilder使用
- verilog代码编写风格(他人整理)
- 红米4的手机被我刷的基带丢失
- Docker入门记录 [1]