删除本地文件夹: import os , string , datetime ; str = '/home/niuguoqin/tmp/tomcat/'; b = (datetime.datetime.now()).second + 5; while 1 : a = datetime.datetime.now(); if a.second == b : files = os.listdir(str); for file in files : os.remove(str+file); b = (a