尝试包裹链接
This commit is contained in:
33
copy.py
Normal file
33
copy.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import shutil
|
||||
import os
|
||||
|
||||
# 1. 设定你要复制哪个文件夹
|
||||
source_folder = "peer-review-process1"
|
||||
|
||||
# 2. 设定你想要生成的多个新名字
|
||||
new_names = ["new-papers1",]
|
||||
|
||||
def batch_copy():
|
||||
# 检查原文件夹是否存在
|
||||
if not os.path.exists(source_folder):
|
||||
print(f"❌ 找不到原文件夹: {source_folder}")
|
||||
return
|
||||
|
||||
for name in new_names:
|
||||
# 检查目标文件夹是否已经存在,避免覆盖
|
||||
if os.path.exists(name):
|
||||
print(f"⚠️ 跳过:'{name}' 已经存在了。")
|
||||
continue
|
||||
|
||||
try:
|
||||
print(f"正在生成 {name}...")
|
||||
shutil.copytree(source_folder, name)
|
||||
print(f"✅ 成功复制为: {name}")
|
||||
except Exception as e:
|
||||
print(f"❌ 复制 {name} 时出错: {e}")
|
||||
|
||||
print("\n所有任务处理完毕!")
|
||||
|
||||
if __name__ == "__main__":
|
||||
batch_copy()
|
||||
input("按回车键退出...")
|
||||
Reference in New Issue
Block a user