반응형
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
- Kotlin
- numpy
- Java
- list
- Github
- Google Excel
- Python
- PySpark
- Redshift
- c#
- Google Spreadsheet
- Tkinter
- math
- Excel
- PostgreSQL
- GIT
- django
- matplotlib
- Presto
- 파이썬
- dataframe
- google apps script
- Apache
- SQL
- array
- string
- gas
- PANDAS
- hive
Archives
- Today
- Total
달나라 노트
Python os : chdir (Directory 위치 변경) 본문
728x90
반응형
import os
os.chdir('../')
os.chdir('test/')
chdi는 Directory의 위치를 바꿔줍니다.
위 코드를 해석해보면
os.chdir('../') -> 현재 위 python 파일이 존재하는 곳을 기준으로 한 단계 위 디렉토리로 이동
os.chdir('test/') -> 한 단계 위 디렉토리로 이동한 채로 해당 디렉토리에 존재하는 test라는 이름의 디렉토리로 이동.
728x90
반응형
'Python > Python os' 카테고리의 다른 글
| Python os : os.path.exists (directory 또는 file 존재 여부 확인) (0) | 2021.06.30 |
|---|---|
| Python os : os.environ.get (environment_variable_name) (0) | 2021.05.11 |
| Python os : getcwd (현재 Directory 위치 출력, 현재 디렉토리 위치, 현재 디렉토리 주소, 현재 디렉토리) (0) | 2020.12.23 |
| Python os : rename (file 이름 바꾸기) (0) | 2020.12.23 |
| Python os : unlink (파일 제거하기) (0) | 2020.12.23 |
Comments