Python equivalent of __LINE__ macro?

David Brady daves_spam_dodging_account at yahoo.com
Mon Jan 7 11:13:33 EST 2002


Hello,

I'm writing a set of Python scripts to be integrated
with Developer Studio as part of a custom build.  If
the script encounters an error, I'd like to be able to
print the line number the error happened, so that
DevStoo users can hit F4 and be taken to the offending
script line.

Is there an easy way to do this?  The handiest thing
would be to have a variable like __LINE__ hanging
around, but in a pinch I suppose we could just use the
traceback and trap all exceptions....  Though I wonder
if there isn't an easier way.

Thanks,

-dB
--
David Brady
daves_spam_dodging_account at yahoo.com
His cooking was so foul, we spelled it 'Stoo' - Sam Wibatt

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/




More information about the Python-list mailing list