利用python实现windows下文件名批量修改

"""
文件名批量修改
示例:尚硅谷2021版React技术全家桶全套完整版(零基础入门到精通-男神天禹老师亲授) (P1. 001_尚硅谷react教程_react简介).mp4
"""
import os, re, shutil
dst_dir  = r"G:\FFOutput\react_shangguigu"  #replace \ with /
os.chdir(dst_dir)
file_list = os.listdir(dst_dir)
for file in file_list:
    new_name = re.findall(r'P.*?\.mp4$',file)  # \u4E00-\u9FA5
    if len(new_name)>=1:
        print(new_name)
        os.rename(file,new_name[0])

参考:
利用python实现windows下文件名批量修改_马昕怡的博客-CSDN博客
几行 Python 代码实现 Windows 下的文件批量重命名_一点孤光-CSDN博客

上一篇:erode腐蚀实现


下一篇:提取视频中的前景物体