{'K1':'311','K2':'311C','K3':'068','K4':'T4','K5':'SF1376705682383','K6':'','K7':'c09ad60d'}转为可loads类型
时间: 2023-12-21 15:28:17 浏览: 178
可以使用Python中的json模块将该字符串转换为可loads类型。具体代码如下:
import json
str_data = "{'K1':'311','K2':'311C','K3':'068','K4':'T4','K5':'SF1376705682383','K6':'','K7':'c09ad60d'}"
json_data = json.loads(str_data.replace("'", "\""))
print(json_data)
输出结果为:
{'K1': '311', 'K2': '311C', 'K3': '068', 'K4': 'T4', 'K5': 'SF1376705682383', 'K6': '', 'K7': 'c09ad60d'}
阅读全文