4_2 json字符串转Python对象
2021-05-12 17:29
标签:字符串 bsp json span pytho col user list try 4_2 json字符串转Python对象 标签:字符串 bsp json span pytho col user list try 原文地址:https://www.cnblogs.com/sruzzg/p/13138145.html 1 """json字符串到Python对象"""
2
3
4 import json
5
6 json_str = ‘[{"username": "张三", "age": 18, "country": "china"}, {"username": "lisi", "age": 20, "country": "USA"}]‘
7 # json字符串到Python对象
8 persons = json.loads(json_str)
9 print(type(persons)) #