How do we convert this below json string into sinle quote in python. Below is my requirement scenario
test.py
import json
import sys
ss = {"fruite":"aapple", "code":"1xyz"}
Tried below commented different ways
#frmt = ("'{}'".format(ss)) ---->Everything is converted to single quotes,
#ss2 = ("'"+ss+"'") not working
jsonld = json.loads(ss)
when i try this json loads its getting json decode error
If i give manually
ss = '{"fruite":"aapple", "code":"1xyz"}'
working json.loads , its didn't get any issue.
Expecting:
Here how do i pass single quotes to my above json string without changing inside double quotes.
Can you please suggest this