我正在尝试将图像保存到特定文件夹,但我不知道将路径放在哪里。savename
在我的路径的尽头是一个变量。
相关代码:
for vv in object_pixel_value_list:
hollowmask = Image.eval(mask,lambda i: findpixels(i, pixval=vv))
blackmask = Image.eval(mask,makeblack)
complete = Image.composite(blackmask,nomask,hollowmask)
savename = 'complete.f%03d.png' % vv
complete.save("~/Desktop/Experiment/Neuro_images/"savename.png, "png")
收到错误:
File "<ipython-input-52-f6a16ee0812c>", line 6
complete.save("~/Desktop/Experiment/Neuro_images/"savename.png, "png")
^
SyntaxError: invalid syntax