考慮到要手工修改許多的文件名太費時,而且網上下載的圖片大多如下(完全不能滿足強迫症)

就用python來代替我們完成這個過程直接貼上代碼
#encoding:utf-8
import os
def rename():
path = "文件路徑" #文件路徑(\注意使用轉義字符)
filelist = os.listdir(path) #文件夾內所有文件
cnt = 0 #計數用
for files in filelist: #遍歷文件夾文件
oldname = os.path.join(path,files) #原完整文件_路徑 + 文件名
if os.path.isdir(oldname):
continue #跳過文件夾
filename = os.path.splitext(files)[0] #獲取文件名
filetype = os.path.splitext(files)[1] #獲取文件後綴
newname = os.path.join(path,str(cnt)+filetype) #新文件名
os.rename(oldname,newname) #重命名
cnt += 1 #計數 +1
rename()
os.path.join 用於拼接路徑
e.g. os.path.join("home","me") 返回/home/me
os.path.isdir 用於判斷文件是否為文件夾格式
os.path.splitext 用於分割文件名與拓展名
->看看效果 (一本滿足!)
