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:
    max_mtime = mtime
max_dir = dirname
max_file = fname
print(max_dir, max_file)
Поиск последнего отредактированного файла в python