#!/usr/bin/python
import os, sys,re
dir = os.getcwd()
print "finding files..."
for root,dirs,files in os.walk(dir):
os.rename(root,root.lower())
for i in files:
filename = root.lower() + "/" + i
if re.search('[A-Z]',filename) != None:
nname = filename.lower()
os.rename(filename, nname)
转载于:https://blog.51cto.com/holy2010/387000