In python simplejson my dictionary is like
>>> s= {u'hello': u"Hi, i'm here"}
>>> simplejson.dumps(s)
'{"hello": "Hi, i\'m here"}'
But I want like
'{"hello": "Hi, i'm here"}'
How to do that?
In python simplejson my dictionary is like
>>> s= {u'hello': u"Hi, i'm here"}
>>> simplejson.dumps(s)
'{"hello": "Hi, i\'m here"}'
But I want like
'{"hello": "Hi, i'm here"}'
How to do that?
What you're seeing is only an internal representation. Python keep it that way so it can escape the quote you're having there.
If you print it, it will appear like normal.
>>> import json
>>> s = '{"hello": "Hi, i\'m here"}'
>>> print(s)
{"hello": "Hi, i'm here"}
Python is telling you the repr
of the string - how to create the string with python syntax. If you want want to see the actual contents of the string, print it:
>>> s= {u'hello': u"Hi, i'm here"}
>>> print simplejson.dumps(s)
{"hello": "Hi, i'm here"}