반응형
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 | 31 |
Tags
- c#
- google apps script
- 파이썬
- Python
- PySpark
- string
- Google Excel
- Excel
- Github
- Apache
- Google Spreadsheet
- Java
- SQL
- GIT
- array
- Kotlin
- Presto
- dataframe
- PANDAS
- Tkinter
- math
- numpy
- matplotlib
- Redshift
- gas
- django
- list
- PostgreSQL
- hive
Archives
- Today
- Total
목록Python/Python os (9)
달나라 노트
Python os : os.remove & os.rmdir (파일 삭제하기, 디렉토리 삭제하기)
os.remove os.remove는 어떤 경로의 파일을 삭제해주는 기능을 제공합니다.os.rmdir은 어떤 경로의 디렉토리를 삭제해주는 기능을 제공합니다. 아래와 같은 디렉토리 구조가 있다고 가정해봅시다.예시 코드는 test.py에 적히고 있습니다. --- dir |--- test.py |--- test_memo.txt |--- test_1 |--- test_2 |--- test_3 |--- test.xlsx 만약 test.py에 코드를 적어서 test_memo.txt를 삭제하고 싶다면 아래처럼 적으면 됩니다. import os os.remove('test_memo.txt') 만약 test_2 디렉토리 안의 test.xlsx를 제거하고싶으면 아래처럼 적으면 됩니다. import os os.remove(..
Python/Python os
2020. 11. 25. 19:18