def from_file_url ( url ) : if url . startswith ( 'file://' ) : url = url [ len ( 'file://' ) : ] . replace ( '/' , os . path . sep ) return url
python change url path using urlparse/unparse
Convert from file : // url to file path
def from_file_url(url):
    """ Convert from file:// url to file path
    """
    if url.startswith('file://'):
        url = url[len('file://'):].replace('/', os.path.sep)

    return url