Python cara mendapatkan nomor baris saat ini

#python3
from inspect import currentframe, getframeinfo

frameinfo = getframeinfo(currentframe())

print(frameinfo.filename, frameinfo.lineno)
Me (Mysterious Monkey)