def dict_to_querystring ( dictionary ) : s = u"" for d in dictionary . keys ( ) : s = unicode . format ( u"{0}{1}={2}&" , s , d , dictionary [ d ] ) return s [ : - 1 ]
python requests dictionary to query string
Converts a dict to a querystring suitable to be appended to a URL .
def dict_to_querystring(dictionary):
    """Converts a dict to a querystring suitable to be appended to a URL."""
    s = u""
    for d in dictionary.keys():
        s = unicode.format(u"{0}{1}={2}&", s, d, dictionary[d])
    return s[:-1]