How to find number of line that is currently executing?

Dr. Phillip M. Feldman pfeldman at
Sat Oct 10 05:46:35 CEST 2009

I would like to put a statement on line N of my program that prints the line
number that is currently executing. This may sound fairly trivial, but I
don't want to hard code the line number because N will change if lines are
inserted or deleted above that point. Any advice will be appreciated.
View this message in context:
Sent from the Python - python-list mailing list archive at

More information about the Python-list mailing list