posixpath.py 文件源码

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

项目:ivaochdoc 作者: ivaoch 项目源码 文件源码
def dirname(p):
    """Returns the directory component of a pathname"""
    p = os.fspath(p)
    sep = _get_sep(p)
    i = p.rfind(sep) + 1
    head = p[:i]
    if head and head != sep*len(head):
        head = head.rstrip(sep)
    return head


# Is a path a symbolic link?
# This will always return false on systems where os.lstat doesn't exist.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号