I just discovered this one yesterday. If you have a dictionary with more than a few items you need to be able to read, the
json.dumps() function takes an
indent argument that automatically formats things legibly for you:
import json ... print json.dumps(my_dict, indent=1)
You can even add
sort_keys=True to... you guessed it! Sort the output alphabetically by keys. More info.