自己做的笔记,不再解释
import os
path = 'C:\\Linux教程/'
fileList = os.listdir(path)
for i in fileList:
oldname = path + os.sep + i # os.sep添加系统分隔符
newname = path + os.sep + i.replace("_linux教程", "")
os.rename(oldname, newname)
自己做的笔记,不再解释
import os
path = 'C:\\Linux教程/'
fileList = os.listdir(path)
for i in fileList:
oldname = path + os.sep + i # os.sep添加系统分隔符
newname = path + os.sep + i.replace("_linux教程", "")
os.rename(oldname, newname)