파이썬 디렉토리 다루기2023. 10. 17.0분디렉토리 다루기#디렉토리 경로 import os os.getcwd() #현재 디렉토리 경로가 반환 os.chdir(path) #작업 디렉토리 경로가 변경 os.listdir() #현재 디렉토리의 리스트를 보여줌 os.listdir(path) #디렉토리의 리스트를 보여줌 os.path.exists(path) #파일,디렉토리가 있는지 확인 os.path.isdir(path) #디렉토리가 있는지 확인 os.path.isfile(path) #파일 존재 확인 os.path.getsize(path) #파일 사이즈 확인 os.makedirs(path) #디렉토리 생성 makedirs는 마지막 디렉토리가 존재하면 오류발생