printing line numbers for debugging purpose

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


"Philippe C. Martin" <philippecmartin at sbcglobal.net> 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
http://www.fuhr.org/~mfuhr/



More information about the Python-list mailing list