#!/usr/bin/env python# -*- coding: utf-8 -*-import os, redef multi_replace(text, adict): rx = re.compile('|'.join(map(re.escape, adict))) def xlat(match): return adict[match.group(0)] return rx.sub(xlat, text)def batrename(curdir, pairs): for fn in os.listdir(curdir): newfn... Read More
posted @ 2012-03-02 15:00 张云贵 Views(4033) Comments(0) Diggs(0) Edit