从不同文件夹读取.png图片并保存到一个文件夹下
作者:互联网
import os from glob import glob from PIL import Image path = './' for i in range(4): path_ = path+ str(i+1) file_list = glob(os.path.join(path_,'*.png')) # print(file_list[0]) img = Image.open(file_list[0]) s = file_list[0].split('/')[-1] # print(s) path_s = path+'rr/'+s img.save(path_s)
标签:读取,img,glob,list,保存,文件夹,file,import,path 来源: https://www.cnblogs.com/tingtin/p/14771704.html