字符串转dict出错::字符串中有转义符号,导致无法正常转dict
# 需要转dict的字符
{"msg_type":2,"msg":"{\"action_type\":1,\"app_id\":6840999917113574920,\"shop_id\":123456}"}
cc = plain_text
print cc
print json.loads(cc)
{"msg_type":2,"msg":"{\"action_type\":1,\"app_id\":6840999917113574920,\"shop_id\":123456}"}
Traceback (most recent call last):
File "/Users/shipengshao/PycharmProjects/douxiaoer/model_/DouyinBusinessCode.py", line 411, in <module>
print json.loads(cc)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 367, in decode
raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 2 column 1 - line 2 column 4 (char 93 - 96)