def pretty(d, indent=0):
    for key in sorted(d.keys()):
        print('\t' * indent + str(key))
if isinstance(d[key], dict):
    pretty(d[key], indent + 1)
else:
    print('\t' * (indent + 1) + str(d[key]))
Python pretty print dictionary of lists, abbreviate long lists