반응형
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
- Github
- Presto
- dataframe
- math
- PySpark
- GIT
- SQL
- gas
- c#
- Google Excel
- Apache
- Google Spreadsheet
- matplotlib
- string
- 파이썬
- Redshift
- list
- PostgreSQL
- Java
- array
- numpy
- google apps script
- PANDAS
- hive
- Tkinter
- Excel
- Python
- django
- Kotlin
Archives
- Today
- Total
목록suffix (1)
달나라 노트
Python pathlib : Path.suffix (파일의 확장자 추출, file extension)
pathlib에서 suffix 속성을 이용하면 파일의 확장자를 받을 수 있습니다. from pathlib import Pathdir_path = '/Users/Documents/code/pythonProject/h_2.py'# Create a Path objectobj_path = Path(dir_path)# Get extension through suffix attributeextension = obj_path.suffix# Show extensionprint(extension)-- Result.py - obj_path = Path(dir_path)먼저 Path를 통해 특정 directory에 존재하는 파일에 대한 object를 만듭니다.그러면 이 object에는 파일에 대한 다양한 정보가 담겨있게 ..
Python/Python ETC
2026. 2. 13. 17:59