Kent Johnson wrote: > On Wed, Feb 11, 2009 at 11:21 PM, bob gailer <bgai...@gmail.com> wrote: > > Thanks Alan and Kent, This works as expected; <code> #!/usr/bin/python import sys import os import time
def mod(): """Find files modified today, given a file path.""" now = time.strftime('%Y-%m-%d', time.localtime()) dir = os.path.dirname(sys.argv[1]) for fname in os.listdir(dir): if fname.endswith('.py'): modtime = os.stat(os.path.join(dir, fname)).st_mtime out = time.strftime('%Y-%m-%d', time.localtime(modtime)) if out == now: print fname, "has changed today. " mod() </code> -david -- powered by Gentoo/GNU Linux http://linuxcrazy.com _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor