Konversi String ke Daftar Kamus
import ast
ast.literal_eval(string_data)
Faithful Flatworm
import ast
ast.literal_eval(string_data)
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 )