■ glob 함수를 사용해 [와 ] 문자를 사용해 파일 및 디렉토리 리스트를 구하는 방법을 보여준다.
▶ 예제 코드 (PY)
1 2 3 4 5 6 7 8 9 10 11 |
import glob list1 = glob.glob("c:\\windows\\*[0-9][0-9].exe") print(list1) r""" ['c:\\windows\\splwow64.exe', 'c:\\windows\\Twunk_16.exe', 'c:\\windows\\Twunk_32.exe', 'c:\\windows\\winhlp32.exe'] """ |