通过python,批量修改指定文件目录下的文件名
import os path = "C:\\Users\\**\\" files = os.listdir(path) os.chdir(path) for file in files: name = file.replace(' ', '') new_name = name[:4] + name[14:] os.rename(file, new_name)
import os path = "C:\\Users\\**\\" files = os.listdir(path) os.chdir(path) for file in files: name = file.replace(' ', '') new_name = name[:4] + name[14:] os.rename(file, new_name)