The following is the code. I roughly understand that sys._getframe(i).f_lineno do, if the number i is bigger than 0. So, it's the line number when you actually make the function call. Python interpreter puts it in a stack. That's how you get the ordering. I mean, that's why when you print out, you have the most recent function call first. So, could anyone explain to me what does sys.getframe(0).f_lineno do? I figured it must have something to do with the current python code maybe.
import sys
#print(sys.version)
a=sys._getframe(0)
print(a)
def one():
two()
def two():
three()
def three():
for num in range(3):
frame=sys._getframe(num)
print(frame.f_lineno)
one()