def add_url_parameters(url, *args, **params):
 for arg in args:
  params.update(arg)
 if params:
  return ('%s?%s' % (url, urlencode(params)))
 return url

def add_url_parameters ( url , * args , ** params ) : for arg in args : params . update ( arg ) if params : return ( '%s?%s' % ( url , urlencode ( params ) ) ) return url
adds parameters to an url -> url?p1=v1&p2=v2 .