반응형
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 | 29 | 30 |
Tags
- hive
- Mac
- c#
- google apps script
- PostgreSQL
- list
- PANDAS
- dataframe
- Redshift
- Tkinter
- Google Excel
- 파이썬
- string
- Kotlin
- numpy
- PySpark
- Excel
- django
- GIT
- Github
- array
- Apache
- SQL
- Google Spreadsheet
- matplotlib
- math
- Python
- Java
- gas
Archives
- Today
- Total
달나라 노트
Python os : rename (file 이름 바꾸기) 본문
728x90
반응형
import os
os.rename("text.txt", "test.txt")
rename은 명시된 file의 이름을 변경하는 역할을 합니다.
위 코드는 해당 코드가 실행되는 디렉토리와 동일한 위치에 있는 text.txt라는 파일의 이름을 test.txt로 변경합니다.
728x90
반응형
'Python > Python os' 카테고리의 다른 글
Python os : chdir (Directory 위치 변경) (0) | 2020.12.23 |
---|---|
Python os : getcwd (현재 Directory 위치 출력, 현재 디렉토리 위치, 현재 디렉토리 주소, 현재 디렉토리) (0) | 2020.12.23 |
Python os : unlink (파일 제거하기) (0) | 2020.12.23 |
Python os : os.makedirs (디렉토리 만들기) (0) | 2020.11.25 |
Python os : os.remove & os.rmdir (파일 삭제하기, 디렉토리 삭제하기) (0) | 2020.11.25 |
Comments