Python 字符串转 JSON

使用 json.loads() 方法可以将字符串解析成 JSON 对象。
示例代码:
`json_string = '{"name": "John", "age": 30, "city": "New York"}'
import json

json_data = json.loads(json_string)

print(json_data)

// 输出:
// {'name': 'John', 'age': 30, 'city': 'New York'}

posted @ 2024-07-24 13:14  tommickey  阅读(285)  评论(0)    收藏  举报