python copy files
import osimport shutil#反馈路径feedbackPath rD:\class\feedback#目标路径dailyPath rE:\daily#查询反馈路径下所有文件origFiles os.listdir(feedbackPath)#遍历反馈文件for file in origFiles:#反馈全路径origPath os.path.join(feedbackPath,file)#分割日期tmp file.split(_)#拿到类型style tmp[-2]#日期date tmp[-1]#去掉扩展名date date.split(.)date.pop()#日期文件夹拼接date ..join(date)#目标全路径destPath os.path.join(dailyPath,date,style)#判断文件夹是否存在不存在则创建if not os.path.exists(destPath):os.makedirs(destPath)#开始拷贝shutil.copy(origPath,destPath)