def pretty_dict_string ( d , indent = 0 ) : s = '' for key , value in sorted ( d . items ( ) ) : s += '    ' * indent + str ( key ) if isinstance ( value , dict ) : s += '\n' + pretty_dict_string ( value , indent + 1 ) else : s += '=' + str ( value ) + '\n' return s
nested dictionary python format string
Pretty output of nested dictionaries .
def pretty_dict_string(d, indent=0):
    """Pretty output of nested dictionaries.
    """
    s = ''
    for key, value in sorted(d.items()):
        s += '    ' * indent + str(key)
        if isinstance(value, dict):
             s += '\n' + pretty_dict_string(value, indent+1)
        else:
             s += '=' + str(value) + '\n'
    return s