def dict_to_string(dictionary, ident = ''):
    """ Recursively prints nested dictionaries."""

    ret = ""
    for key, value in dictionary.iteritems():
        if isinstance(value, dict):
            ret += '%s%s:\n' %(ident, key) 
            ret += dict_to_string(value, ident+'    ')
        else:
            ret += ident+'%s = %s\n' %(key, value)
    return ret