I am trying to make a list of JSON objects in python I have an list of keys, and a list of items, so keys is something like this, by the way I am getting this list from the web so it is always a single quote
keys = ['one', 'two', 'three']
and then items something like this
rows = [[foo, fuu, fhh], [bar, bat, bak]]
And what I want is
[{"one":"foo", "two":"fuu", "three":"fhb"},
{"one":"bar", "two":"bat", "three":"bak"}]
And here is what I am trying but I end up with this
['{"one":"foo", "two":"fuu", "three":"fhb"}',
'{"one":"bar", "two":"bat", "three":"bak"}']
Which makes it no longer valid JSON:
results = []
info = {}
for row in items:
i = 0
for item in row:
info[keys[i]] = item
data = json.dumps(info)
i += 1
results.append(data)
So how can I get rid of those single quotes and just have double quotes and valid JSON?
Thanks