Scott David Daniels wrote:
To be a trifle more explicit, turn:
...
if __name__ == '__main__':
main()
into:
...
if __name__ == '__main__':
try:
main()
except Exception, why:
print 'Failed:', why
import sys, traceback
traceback.print_tb(sys.exc_info()[2])
raw_input('Leaving: ')
Note that building your script like this also allows you to
open the interpretter, and type:
import mymodule
mymodule.main()
in order to examine how it runs.
Thanks alot, this was exactly what I was looking for!
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list