python print current line number of running python file

45 Views Asked by At

is there any easy way to print current line number of running python file?

a = 1
print(__line__)
b = 2
c = a+b
print(__line__)

Desired output:

2
5
0

There are 0 best solutions below