I like the pprint module in Python. I use it a lot for testing and debugging. I frequently use the width option to make sure the output fits nicely within my terminal window
def pprint_od(od): print "{" for key in od: print "%s:%s,\n" % (key, od[key]) # Fixed syntax print "}"
There you go ^^
for item in li: pprint_od(item)
or
(pprint_od(item) for item in li)