By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,096 Members | 1,568 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,096 IT Pros & Developers. It's quick & easy.

printing line numbers for debugging purpose

P: n/a
Hi,

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 ?

ex: in C/C++ I would use the macros __FILE__ and __LINE__.

Regards,

Philippe

--
***************************
Philippe C. Martin
SnakeCard LLC
www.snakecard.com
***************************

Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Philippe C. Martin" <ph*************@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/
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.