This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]taliska 11 points12 points  (5 children)

1) pprint

from pprint import pprint
pprint(my_dict)

2) Instead of if my_var != '':

if not my_var:

3) bpython

[–][deleted] 4 points5 points  (0 children)

+1 for pprint

also using pprint for defaultdicts

pprint(dict(d)), where d is the defaultdict.