📜  如何避免python中的json解码问题 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:12.162000             🧑  作者: Mango

代码示例1
incorrect_json = '{ name":"John "age":30 "car:"None" }'
try:
    a_json = json.loads(incorrect_json)
    print(a_json)
except json.decoder.JSONDecodeError:
    print("String could not be converted to JSON")