标签:
#!/usr/bin/python
import os
path1=‘/root/model/‘
file=os.listdir(path1)
num=file.index(‘index.html‘)
del file[num]
c=str(file)
c=c.replace(‘_‘,‘.‘)
c=c.title()
c=c.replace(‘Model.Php‘,‘class.php‘)
e=list(eval(c))
b=file
a=dict(zip(b,e))
for key in a.keys():
os.rename(os.path.join(path1,key),os.path.join(path1,a[key]))
标签:
原文地址:http://www.cnblogs.com/yang68h/p/5825803.html