[Python] iglob메소드와 재귀를 이용한 모든 하위 디렉토리 특정 확장자 파일 검색 path경로 기준 모든 하위 디렉토리에서 pdf파일만 검출하고 싶을 때, from glob import iglob for file in iglob(r'path\**\*.pdf', recursive=True): print(file) * python 3.5부터 ** 재귀 (recursive) 지원 Python/Python Programming 2019.10.06