I am getting output as json string with the following code. But I require it as JSON dict without leading and trailing quotes. How can I do that?
It seems to work if I uncomment line4 but not with raw input.
def main(args):
f = open(args[1], 'w')
inp = raw_input("Enter a Dict")
# inp = {"a":1,"b":2}
django.utils.simplejson.dumps(inp, f)
if __name__=="__main__":
import sys
main(sys.argv)
#Recieved O/P: "{'a':1,'b':2'}
#Required O/P: {'a':1,'b':2}