Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python how to get current line number

#python3
from inspect import currentframe, getframeinfo

frameinfo = getframeinfo(currentframe())

print(frameinfo.filename, frameinfo.lineno)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #current #line #number
ADD COMMENT
Topic
Name
4+8 =