Capturing exceptions?

Michael Hudson mwh at
Wed Aug 25 19:23:51 CEST 2004

Dfenestr8 <chrisdewinN0SPAM at> writes:

> Hi.
> 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

Read up on the traceback module.


6. Symmetry is a complexity-reducing concept (co-routines include
   subroutines); seek it everywhere.
  -- Alan Perlis,

More information about the Python-list mailing list