import os
import shutil
d=r'C:appData手机掌厅数据导入IE20180926cut'
j=0
for i in os.listdir(d):
j=j+1
# newfilename = i.replace('jack','sesvc'),将文件名中“r0”替换成“r0_v2”
newfilename = i.replace('r0', 'r0_v2')
oldfullname = d+'\'+i
newfullname = d+'\'+newfilename
shutil.move(oldfullname,newfullname)
print(i+' 改成了:'+newfilename+' 第'+str(j)+'文件')
print('OK')