Q:

convert string to list of dictionaries

import ast
ast.literal_eval(string_data)
0
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 )
0

New to Communities?

Join the community