Python3之PIL模块移除remove打开的图片

  1. 问题描述:

    PIL模块中有打开图片的方法open却没有close方法

  2. 解决方案:

f = open(fileName,'r')
im = Image.open(f)
f.close()
x,y = image.size
if x <1261 or y < 680:
      os.remove(fileName)

猜你喜欢

转载自blog.csdn.net/qq_33733970/article/details/80751572