改名移动批量文件 shutil.copy

import glob
import os

import shutil

filePath = 'F:/project/Breast/InBreast/INBreast/imgout/'
newFilePath = 'F:/project/Breast/InBreast/INBreast/imgout1/'

filename = os.listdir(filePath)
for i in filename:
    jpg = os.path.join(filePath, i)
    print(i[0:8])
    # shutil.copy(newFilePath+'/'+i,filePath+'/'+i)
    shutil.copy(filePath + '/' + i, newFilePath + '/' + i[0:8]+'.png')
# 将filepath里面的所有图片拷贝到newfilepath里面

 

posted on 2019-07-15 20:08  Hebye  阅读(497)  评论(0编辑  收藏  举报

导航