How to find number of line that is currently executing?
clp2 at rebertia.com
Sat Oct 10 05:54:32 CEST 2009
On Fri, Oct 9, 2009 at 8:46 PM, Dr. Phillip M. Feldman
<pfeldman at verizon.net> wrote:
> 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.
If you're doing this for debugging, it's often more convenient to just
come up with a unique string you can grep for, but anyway:
More information about the Python-list