I have to parse a JSON structure that contains another JSON struct embedded in it. What is the cleanest way to convert the quotes? I came up with this way but wanted to know if there is some ready made way to do it.
def clean():
kk = """{'id': 'pq-123', 'content': "{'a': 'xyz-123'}", 'img': 'flash.jpg'}"""
st = kk.find('"')
end = 1 + st + kk[st+1:].find('"')
x = kk[0:st].replace("'", '"') + kk[st] + kk[st+1:end+1] + kk[end+1:].replace("'", '"')
return x