0
디렉토리에 파일이 많습니다. 이름에 "dog"가 붙은 가장 최근 파일을 찾고 싶습니다. 모든 확장자.Python 파일 이름에 특정 문자열이있는 가장 최근 파일 찾기
path = 'my_path'
name = 'dog'
files = sorted([f for f in os.listdir(path) if f.????(name)])
recent = files[-1]
print "The most recent file with 'dog' in the name is :", recent
감사