My code:
import simplejson as json
s = "{'username':'dfdsfdsf'}" #1
#s = '{"username":"dfdsfdsf"}' #2
j = json.loads(s)
#1
definition is wrong
#2
definition is right
I was heard that in Python that single double quote can be interchangable, can anyone explain this for me?
The above code snippet should work.
you can use
ast.literal_eval()