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)
python删除gif图像
最新推荐文章于 2023-07-12 18:25:53 发布