files.py 文件源码

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

项目:Hawkeye 作者: tozhengxq 项目源码 文件源码
def flat_rootname(filename):
    """A base for a flat file name to correspond to this file.

    Useful for writing files about the code where you want all the files in
    the same directory, but need to differentiate same-named files from
    different directories.

    For example, the file a/b/c.py will return 'a_b_c_py'

    """
    name = ntpath.splitdrive(filename)[1]
    return re.sub(r"[\\/.:]", "_", name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号