我真的懵了:
import os
from os import mkdir,walk,rename,path
from shutil import move,copy
path="个人文件袋"
for filepath,folders,files in walk(path):
# print(filepath,folders,files)
# 注意我们需要用文件夹名字 作为 文件夹下文件的名字,同时加上顺序
counter=0
for file in files:
print(filepath)
type_name=filepath.split("\\")[-1]
renamed=type_name+str(counter)+"-个人文件袋"
rename(os.path.join(filepath,file),renamed)
counter+=1
求求解答,我真的不知道怎么回事(路径什么的都没问题)