def printplus(obj):
    """
    Pretty-prints the object passed in.
    """
if isinstance(obj, dict):
    for k, v in sorted(obj.items()):
        print('{0}: {1}'.format(k, v))
elif isinstance(obj, list) or isinstance(obj, tuple):
    for x in obj:
        print(x)
else:
    print(obj)
Readably print out a python dict() sorted by key