1. 列出文件名和后缀
os.path.splitext(image_path)
2. 遍历文件夹
for (dirpath, dirname, dirfile) in walk(dir + "/image/image/"):
for i in dirfile:
file_end = i.split(".")[1]
pic_webp(dirpath+"/"+i, file_end, outPath)
1. 列出文件名和后缀
os.path.splitext(image_path)
2. 遍历文件夹
for (dirpath, dirname, dirfile) in walk(dir + "/image/image/"):
for i in dirfile:
file_end = i.split(".")[1]
pic_webp(dirpath+"/"+i, file_end, outPath)