Name: Anonymous 2009-01-20 23:22
import os, md5;
for root, dirs, files in os.walk(os.path.abspath('')):
for f in files:
e = os.path.splitext(f)[1]
if (e and e not in [".py",".db"]):
h = md5.new(file(f,'rb').read()).hexdigest()
n = h + e
try:
os.rename(f,n)
except WindowsError:
os.unlink(n)
os.rename(f,n)
print n + " " + fHow do I optimize this, I'm watching SICP right now