반응형
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
- SQL
- google apps script
- django
- array
- Kotlin
- Java
- Mac
- GIT
- Github
- Apache
- string
- PostgreSQL
- PANDAS
- math
- 파이썬
- Google Spreadsheet
- Tkinter
- dataframe
- hive
- matplotlib
- Python
- Excel
- Google Excel
- gas
- Redshift
- PySpark
- list
- numpy
- c#
Archives
- Today
- Total
목록Python (384)
달나라 노트
Python os : chdir (Directory 위치 변경)
import os os.chdir('../') os.chdir('test/') chdi는 Directory의 위치를 바꿔줍니다. 위 코드를 해석해보면 os.chdir('../') -> 현재 위 python 파일이 존재하는 곳을 기준으로 한 단계 위 디렉토리로 이동 os.chdir('test/') -> 한 단계 위 디렉토리로 이동한 채로 해당 디렉토리에 존재하는 test라는 이름의 디렉토리로 이동.
Python/Python os
2020. 12. 23. 03:46
Python os : getcwd (현재 Directory 위치 출력, 현재 디렉토리 위치, 현재 디렉토리 주소, 현재 디렉토리)
import os print(os.getcwd()) os.getcwd는 현재 code가 실행되는 위치나 실행된 code가 적힌 python file이 있는 directory를 반환합니다.
Python/Python os
2020. 12. 23. 03:42
Python os : rename (file 이름 바꾸기)
import os os.rename("text.txt", "test.txt") rename은 명시된 file의 이름을 변경하는 역할을 합니다. 위 코드는 해당 코드가 실행되는 디렉토리와 동일한 위치에 있는 text.txt라는 파일의 이름을 test.txt로 변경합니다.
Python/Python os
2020. 12. 23. 03:41