util.py 文件源码

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

项目:gilt 作者: metacloud 项目源码 文件源码
def copy(src, dst):
    """
    Handle the copying of a file or directory.

    The destination basedir _must_ exist.

    :param src: A string containing the path of the source to copy.  If the
     source ends with a '/', will become a recursive directory copy of source.
    :param dst: A string containing the path to the destination.  If the
     destination ends with a '/', will copy into the target directory.
    :return: None
    """
    try:
        shutil.copytree(src, dst)
    except OSError as exc:
        if exc.errno == errno.ENOTDIR:
            shutil.copy(src, dst)
        else:
            raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号