for dirname, subdirs, files in os.walk('.'):
    for fname in files:
        full_path = os.path.join(dirname, fname)
mtime = os.stat(full_path).st_mtime
if mtime > max_mtime:
    pass
Finding most recently edited file in python