Python os
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)
...
原创
2022-05-24 16:53:12 ·
81 阅读 ·
0 评论