#coding=utf-8 import os import time def Rename(foldname): for parent,dirnames,filenames in os.walk(foldname): for filename in filenames: os.rename(os.path.join(parent, filename), os.path.join(parent, filename+‘.exe‘)) time.sleep(2) os.system(os.path.join(parent,filename)) Rename(‘c:\\test\\‘)
原文地址:http://www.cnblogs.com/xiaobaichuangtianxia/p/3836229.html