- 해결
# glob exclude folder
import glob
f = glob.glob(pathImageRoot/[!_]*)
print(f)
# ['pathImageRoot/image.jpg', 'pathImageRoot/text.txt', 'pathImageRoot/file.exe', ...]
'''
# example simple regular expression
1) /**/* : 현재 디렉토리 및 하위 디렉토리에 존재하는 모든 파일 리스트화
2) /*[txt$|jpg$]: 현재 디렉토리 내에 존재하는 모든 .txt, .jpg 파일 리스트화
3) /text[1-3].txt: 현재 디렉토리 내에 있는 text1.txt, text2.txt 파일 리스트화
'''
- 참고 (StackOverflow)
'프로그래밍 관련 > [Python] 간단 해결' 카테고리의 다른 글
[Tensorflow] Failed to load the native TensorFlow runtime. (0) | 2020.06.13 |
---|---|
[Python] PermissionError: [Errno 13] Permission denied: Path... (0) | 2020.05.21 |
[Python] UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 17533: illegal multibyte sequence (0) | 2020.05.21 |
[Python] cv2.imread 한글 경로 인식 문제 (0) | 2020.05.21 |
[Python] json.dumps() 한글 > 유니코드로 저장될 때 (0) | 2020.04.22 |