using simplejson.dumps to encode a dictionary to json

Aaron aaron.jerling at gmail.com
Tue Mar 15 15:56:39 EDT 2011


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": "CFD_Demo"}]}

as per usual json.

A



More information about the Python-list mailing list