python字符串转字典

import json

str_Detail = '{"rowOne":"A","rowTwo":"B","rowThree":"C"}'
print(str_Detail, type(str_Detail))
'''
{"rowOne":"A","rowTwo":"B","rowThree":"C"} <class 'str'>
'''
dict_Detail = json.loads(str_Detail)
print(dict_Detail, type(dict_Detail))
'''
{'rowOne': 'A', 'rowTwo': 'B', 'rowThree': 'C'} <class 'dict'>
'''

 

posted @ 2021-05-27 14:06  OTAKU_nicole  阅读(149)  评论(0编辑  收藏  举报