Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- YOLO
- Visual Studio
- VS Code
- JSON
- mysql
- paramiko
- Python
- SSH
- C++
- 컨테이너
- Linux
- C#
- Selenium
- pip
- windows forms
- ubuntu
- 프로그래머스
- pytorch
- LIST
- 핑거스타일
- Numpy
- 채보
- error
- Docker
- pandas
- 오류
- OpenCV
- C
- 기타 연주
- label
Archives
- Today
- Total
기계는 거짓말하지 않는다
Python 파일 이름 변경 본문
import os
dir_path = "test/files"
file_names = os.listdir(dir_path)
for name in file_names:
src = os.path.join(dir_path, name)
dst = name.replace("old_char", "new_char")
dst = os.path.join(dir_path, dst)
os.rename(src, dst)
'Python' 카테고리의 다른 글
Python String에 여러 요소가 있는지 판별 (0) | 2021.08.28 |
---|---|
Python argparse module (0) | 2021.08.28 |
Python Numpy any Filter (0) | 2021.08.15 |
Python OpenCV, PIL Image shape, size (0) | 2021.08.10 |
Python PermissionError: [Errno 13] Permission denied (0) | 2021.08.05 |
Comments