printing line numbers for debugging purpose

Michael Fuhr mfuhr at
Sat Jan 8 18:36:18 EST 2005

"Philippe C. Martin" <philippecmartin at> writes:

> All of the methods from my program return None on error (i.e; I do not
> want to assert and have the program exit).
> Is it possible to print the current source file name/line number ?

Someone else posted an example using an exception handler.  See
also the traceback module.

Michael Fuhr

More information about the Python-list mailing list