python超时机制的实现解决办法

python超时机制的实现
有个文件夹,下面会动态生成一些文件,如何实现在经过了指定时间后(例如20s),删除已经超时的文件?(超时:就是文件从生成的时刻开始计时,超过20s则超时)

------解决方案--------------------
Python code
import os.path
import time
print 'Access time:',time.ctime(os.path.getatime(__file__))
print 'Modified time:',time.ctime(os.path.getctime(__file__))
print 'Change time:',time.ctime(os.path.getmtime(__file__))

------解决方案--------------------
看了你上一个帖子,
定时扫描文件夹获取文件名的时候,顺便把文件创建时间获取了,存起来

------解决方案--------------------
随便写了个练手代码
code at here