I\'d like to dump a Python dictionary into a JSON file with a particular custom format. For example, the following dictionary my_dict,
\'text_li
You will need to create a subclass of the json.JSONEncoder class and override the methods for each type of value so they write the format you need. You may end up re-implementing most of them, depending on what your formatting needs are.
http://docs.python.org/2/library/json.html has an example for extending the JSONEncoder.