我在python-3.6中使用了conda接口,它没有将图像保存到指定的路径。我在做什么错了?
import os
from PIL import Image
from shutil import copyfile
dire=r'C:\Users\JZ\Desktop\books'
fnames = [r'C:\Users\JZ\Desktop\DLIMAGES\WarningsNegative.{}.jpg'.format(i) for i in range(0, 1665)]
gnames=['Warnings.{}'.format(i) for i in range(0, 1665)]
for each in range(0,1665):
path=os.path.join(dire,gnames[each])
print('dst=', path)
im=Image.open(fnames[each])
temp=im.copy()
#gene=str(path).replace("\\","/")
with open(path,'wb') as newline:
temp.save(newline,"JPEG")