"ej" <"ej atwellkeepercom"@bag.python.org> wrote
> try:
> {}['foo']
> except Exception, x:
> print "class of x =", x.__class__
> print "type(x) =", type(x)
> print "dir(x) =", dir(x)
>
> If you don't handle an exception, the interpreter will quit and print a
> stack trace. What I'm not seeing is how to handle the exception, but still
> get the stack trace as a string so I could dump it to a log file or email it
> or something.
the second example on this page shows you how to do that:
http://effbot.org/librarybook/traceback
</F>
--
http://mail.python.org/mailman/listinfo/python-list