내에서 호출 현재 모듈/라인을 확인하는 방법 :파이썬 반성 - 나는 기능이 기능
# utils.py
def hello(name='World'):
# Detect where I'm being called from.
print('Hi, %s. You called this from %s at line # %d.' % (name, mod, lineno))
# ``mod`` and ``lineno`` on previous line would have been set in real use.
그 기능을 가져오고 다른 곳
# other.py (this comment at line # 138)
from utils import hello
hello('Johnny') # From inside ``hello`` I want to be able to detect that this
# was called from other.py at line # 140