def dict_to_str(args, sep=u'&'):
 t = []
 for k in args.keys():
  t.append(((str(k) + u'=') + urllib.quote(str((args[k] or u'')))))
 return sep.join(t)

def dict_to_str ( args , sep = u'&' ) : t = [ ] for k in args . keys ( ) : t . append ( ( ( str ( k ) + u'=' ) + urllib . quote ( str ( ( args [ k ] or u'' ) ) ) ) ) return sep . join ( t )
converts a dictionary to url .