File name and line number

Marielle Fois im99_foa at nada.kth.se
Fri Aug 10 20:36:54 CEST 2001


Hello,

Is is possible to know the name of a python file within the file
itself? And the line number of the instruction that is currently
being executed? Suppose I have a function, and I want this function
to take two arguments, first the name of the file where it is placed,
and second at which line number. Is there any way of doing this?

Please send answers also to my email address.

Thanks in advance,

Marielle




More information about the Python-list mailing list