
import imghdr
import os
def del_type(path):
if imghdr.what(path)=='gif':
os.remove(path)
print('remove--{}'.format(path))
image_path=r'F:\SOMKE\JPEGImages'
img_list=os.listdir(image_path)
for img in img_list:
full_path=os.path.join(image_path,img)
del_type(full_path)
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)