Re: using simplejson.dumps to encode a dictionary to json

2011-03-15 Thread Aaron
Rock on, thanks guys. I'm on python 2.5 btw - I use it with google app engine so cannot upgrade unfortunately. A -- http://mail.python.org/mailman/listinfo/python-list

Re: using simplejson.dumps to encode a dictionary to json

2011-03-15 Thread MRAB
On 15/03/2011 19:56, Aaron wrote: If I print authreq_data to screen I get {"req": {"username": "##", "password": "#", "productType": "CFD_Demo"}} Essentially I want the inner brackets to be [ ] instead of {} but alternating on each level so it would be: {"req": [{"username": "##

Re: using simplejson.dumps to encode a dictionary to json

2011-03-15 Thread Chris Rebert
On Tue, Mar 15, 2011 at 12:56 PM, Aaron wrote: > If I print authreq_data to screen  I get > > {"req": {"username": "##", "password": "#", "productType": > "CFD_Demo"}} > > Essentially I want the inner brackets to be  [ ] instead of {} but > alternating on each level so it would be: > > {

Re: using simplejson.dumps to encode a dictionary to json

2011-03-15 Thread MRAB
On 15/03/2011 19:40, Aaron wrote: Hi there, I am attempting to use simplejson.dumps to convert a dictionary to a json encoded string. For some reason this doesn't work - it would be awesome if someone could give me a clue as to why. loginreq = {"username":username, "password":password, "prod

Re: using simplejson.dumps to encode a dictionary to json

2011-03-15 Thread Aaron
I'm attempting to write an xml as a json object. the xml object is authreq_data = """ %s CFD_Demo %s """ %(username, password) -- http://mail.python.org/mailman/listinfo/python-list

Re: using simplejson.dumps to encode a dictionary to json

2011-03-15 Thread Aaron
If I print authreq_data to screen I get {"req": {"username": "##", "password": "#", "productType": "CFD_Demo"}} Essentially I want the inner brackets to be [ ] instead of {} but alternating on each level so it would be: {"req": [{"username": "##", "password": "#", "productType

using simplejson.dumps to encode a dictionary to json

2011-03-15 Thread Aaron
Hi there, I am attempting to use simplejson.dumps to convert a dictionary to a json encoded string. For some reason this doesn't work - it would be awesome if someone could give me a clue as to why. loginreq = {"username":username, "password":password, "productType":"CFD_Demo"} authreq_data =