Código Python:
Ver originalif datetime.datetime.fromtimestamp(os.path.getmtime(ruta)) + datetime.timedelta(minutes=5) < datetime.datetime.now():
Lee la documentación
http://docs.python.org/2/library/datetime.html
Otra cosa deberías empezar a leer un libro sobre python te recomiendo dive into python.