constants.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:pybel 作者: pybel 项目源码 文件源码
def get_uri_name(url):
    """Gets the file name from the end of the URL. Only useful for PyBEL's testing though since it looks specifically
    if the file is from the weird owncloud resources distributed by Fraunhofer"""
    url_parsed = urlparse(url)

    if url.startswith(FRAUNHOFER_RESOURCES):
        return url_parsed.query.split('=')[-1]
    else:
        url_parts = url_parsed.path.split('/')
        return url_parts[-1]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号