import os
for filePath in [entry.path for entry in os.scandir(r'J:\广场舞VCD\2')]:
os.rename(filePath,filePath.replace('.DAT','.MPEG'))
本文介绍了一个使用Python脚本批量将目录下所有文件扩展名从.DAT更改为.MPEG的方法。此脚本适用于需要快速修改大量文件扩展名的场景,如整理广场舞VCD视频文件。
import os
for filePath in [entry.path for entry in os.scandir(r'J:\广场舞VCD\2')]:
os.rename(filePath,filePath.replace('.DAT','.MPEG'))

被折叠的 条评论
为什么被折叠?