文件目录结构
C:.
├─data
│ ├─photos
│ │ ├─1
│ │ ├─2
│ │ ├─3
│ │ ├─4
│ │ ├─5
│ │ ├─6
│ │ ├─7
│ │ └─8
│ └─photos_new
│ ├─1
│ ├─2
│ ├─3
│ ├─4
│ ├─5
│ ├─6
│ ├─7
│ └─8
└─try.py
代码
import os
import shutil
from tqdm import tqdm
# 获取当前脚本所在目录
current_directory = os.path.dirname(os.path.abspath(__file__))
# 指定原始photos文件夹的路径
photos_directory = os.path.join(current_directory, 'photos')
# 指定新的photos文件夹的路径
new_photos_directory = os.path.join(current_directory, 'photos_new')
# 创建新的photos文件夹
if not os.path.exists(new_photos_directory):
os.makedirs(new_phot

最低0.47元/天 解锁文章
593

被折叠的 条评论
为什么被折叠?



