• 지금까지는 같은 디렉토리나 같은 파이썬 라이브러리에 있는 모듈을 참조하였는데, 이 모듈이나 패키지의 위치를 확인할 수 있는 방법을 알아보자.
from travel import * trip_to = thailand.ThailandPackage() trip_to.detail()
import inspect import random print(inspect.getfile(random)) print(inspect.getfile(thailand))

출력값은 다음과 같다.

# random file의 위치 C:\Users\(내 이름)\AppData\Local\Programs\Python\Python39\lib\random.py # thailand file의 위치 C:\Intellij\python\나도코딩\기본편(6H)\travel\thailand.py