파이썬 OS 모듈 - 현재 경로, 경로 변경, 디렉터리 검색 os.getcwd os.chdir os.listdir
현재 경로 getcwd() / 경로 변경 chdir() getcwd() 은 파이썬을 실행한 현재 경로를 반환합니다. import os path = os.getcwd() print(path) os.chdir('test_dir') path = os.getcwd() print(path) 더보기 C:\Users\Desktop\Reference\Example\ex_os C:\Users\Desktop\Reference\Example\ex_os\test_dir 응용) 커맨드라인 구현 -1 cmd = { 'pwd': os.getcwd, 'cd': os.chdir } while True: ip = input('>> ') splt = ip.split(' ') if splt[0] not in cmd.keys(): print..