Answers for "python how to get current line number"

0

python how to get current line number

#python3
from inspect import currentframe, getframeinfo

frameinfo = getframeinfo(currentframe())

print(frameinfo.filename, frameinfo.lineno)
Posted by: Guest on January-18-2021

Code answers related to "python how to get current line number"

Python Answers by Framework

Browse Popular Code Answers by Language