Python - 批量改变文件名
import os
import sys
import datetime
path = "E:\python_test"
datename = '2016-02-11'
a = datetime.datetime.strptime(datename,'%Y-%m-%d')
for (path,dirs,files) in os.walk(path):
for filename in files:
a = a + datetime.timedelta(1)
newname = a.strftime('%Y-%m-%d')+'_'+filename
os.rename(path+"\\"+filename , path+"\\"+newname)