Capturing exceptions?

Mathias Waack M.Waack at gmx.de
Wed Aug 25 13:19:06 EDT 2004


Dfenestr8 wrote:
> What's the easiest way to capture the traceback from an exception,
> and write it to a file? Ideally, I'd like to be able to do
> something like:
> 
>>try:
>>main()
>>except:
>>write the traceback to a file

Have a look at the traceback module. 

Mathias



More information about the Python-list mailing list