import os from os.path import join, abspath from glob import glob import subprocess import argparse config_mapping = { "new-metrics-exp-23" : "./config/tf_effnet_v2_s_in21k.yaml", } import shutil def copytree(src, dst, symlinks=False, ignore=None):
时间: 2024-04-09 07:27:08 浏览: 100
如何使用python3获取当前路径及os.path.dirname的使用
5星 · 资源好评率100%
def copytree(src, dst, symlinks=False, ignore=None):
"""
Recursively copy a directory tree.
Args:
src (str): Source directory path.
dst (str): Destination directory path.
symlinks (bool, optional): If True, copy symbolic links as symbolic links.
ignore (callable, optional): A function that takes a directory name and filenames as arguments
and returns a list of filenames to ignore.
"""
for item in os.listdir(src):
s = os.path.join(src, item)
d = os.path.join(dst, item)
if os.path.isdir(s):
shutil.copytree(s, d, symlinks, ignore)
else:
shutil.copy2(s, d)
阅读全文