python 批量修改文件名代码
下面是python 批量修改文件名代码view plaincopy to clipboardprint?
#!/usr/bin/env python
#coding=utf-8
import os,os.path
import shutil,string
dir = C:\test
for i in os.listdir(dir):
newfile = i.replace(.,_)
oldfullfile = dir \ i
newfullfile = dir \ newfile
print oldfullfile
print newfullfile
shutil.move(oldfullfile,newfullfile)
print i
补充:Web开发 , Python ,