Answers for "python list of dictionaries string to object"

0

convert string to list of dictionaries

import ast
ast.literal_eval(string_data)
Posted by: Guest on May-18-2020
0

python convert string to list of dictionaries

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 )
Posted by: Guest on May-05-2020

Code answers related to "python list of dictionaries string to object"

Python Answers by Framework

Browse Popular Code Answers by Language