Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

python convert string to list of dictionaries

import json

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

for dictItem in dataList:
    for key , val in dictItem.items():
        print( key , val )
 
PREVIOUS NEXT
Tagged: #python #convert #string #list #dictionaries
ADD COMMENT
Topic
Name
5+4 =