复制代码 代码如下:
import os
from PIL import Image
for j in range(10,121):
p = 'C:/'+str(j)+'/' #图片目录
a = os.listdir(p)
for i in a:
path = p+i
print path #图片名称
try:
f = Image.open(path)
# print f
except:
continue
else:
xsize,ysize=f.size
box=(0,0,xsize,ysize-37)
f.crop(box).save(path)
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8