def urljoin ( * args ) : value = "/" . join ( map ( lambda x : str ( x ) . strip ( '/' ) , args ) ) return "/{}" . format ( value )
python string concat "a"/"b"
Joins given arguments into a url removing duplicate slashes Thanks http : // stackoverflow . com / a / 11326230 / 1267398
def urljoin(*args):
    """
    Joins given arguments into a url, removing duplicate slashes
    Thanks http://stackoverflow.com/a/11326230/1267398

    >>> urljoin('/lol', '///lol', '/lol//')
    '/lol/lol/lol'
    """
    value = "/".join(map(lambda x: str(x).strip('/'), args))
    return "/{}".format(value)