↓ 复制文件 ↓
# source_file:源路径, target_ir:目标路径
shutil.copy(source_file,target_ir)
↓ 复制文件夹, 二级, 如要递归无限级请自行改造 ↓
# source_file:源路径, target_ir:目标路径
def cover_files(source_dir, target_ir):
for file in os.listdir(source_dir):
source_file = os.path.join(source_dir, file)
if os.path.isfile(source_file):
shutil.copy(source_file, target_ir)