I have a dict like :
data = {
'key1': value1,
'key2': value2
}
Now how do i append a key value list stored in a string like
str0 = "key3:val3, key4:val4"
or
str = "{key3:val3, key4:val4}"
into the above json dict?
print data.update(str)
print data.update(ast.literal_eval(str))
gives error.
(also tried with quotes to keys) raise ValueError('malformed string')
ValueError: malformed string