📜  python 将字符串转换为字典列表 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:01.855000             🧑  作者: Mango

代码示例2
import json

with open('.listOfDicts.txt', 'r') as file:
    dataList = json.loads(file.read().replace('\n', ''))

for dictItem in dataList:
    for key , val in dictItem.items():
        print( key , val )