일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- PostgreSQL
- Converting
- evaluation
- LLM
- AI
- file
- enV
- Laravel
- Windows
- GitLab
- Mac
- Linux
- docker
- pandas
- numpy
- Database
- Package
- judge
- list
- KAKAO
- git
- TORCH
- Container
- pytorch
- DB
- CUDA
- format
- Python
- Paper
- Flask
Archives
- Today
- Total
목록Search (1)
Daily Develope
[Python] 폴더 및 파일 탐색
ㅇ 폴더 및 파일 탐색 - 예) target_dir 에서 png, jpg 파일 출력 (non-recursion) target_dir = f'{os.getcwd()}/sample' for root, dirs, files in os.walk(target_dir): for file in files: if file.endswith(('.png', 'jpg')): print(file) ㅇ 파일 존재 확인 import pathlib if pathlib.Path('myfile.txt').exists(): print("exists")
Develope/Python
2022. 4. 6. 09:22