1.현재 파일의 이름 & 경로
import os
# 현재 파일 이름
print(__file__)
# 현재 파일 실제 경로
print(os.path.realpath(__file__))
# 현재 파일 절대 경로
print(os.path.abspath(__file__))
2.현재 파일의 디렉토리 경로
import os
# 현재 폴더 경로; 작업 폴더 기준
print(os.getcwd())
#현재 파일의 폴더 경로; 작업 파일 기준
print(os.path.dirname(os.path.realpath(__file__)))
3.현재 디렉토리의 파일 리스트
import os
print(os.listdir(os.getcwd()))
4.작업 디렉토리 변경
import os
os.chdir("/home/dada/test/")