[FRPythoneers] Printing a traceback

Evelyn Mitchell efm at tummy.com
Mon Aug 27 10:44:17 MDT 2001


On Mon, Aug 27, 2001 at 10:33:55AM -0600, PC Drew wrote:
> you could create a new StringIO object and store that object in
> sys.__stderr__
> 
> ----- Original Message -----
> From: "Ken Kinder" <kkinder at tridog.com>
> To: "Front Range Pythoneers" <frpythoneers at lists.community.tummy.com>
> Sent: Monday, August 27, 2001 10:27 AM
> Subject: [FRPythoneers] Printing a traceback
> 
> 
> > If I have a statement like:
> >
> > try:
> > (bad code)
> > except:
> > typ, val, tb = sys.exc_info()
> > ....
> >
> > How do I put the traceback-like text in a string variable? That is, I
> > want the text that would otherwise be printed to sys.stderr if I hadn't
> > have caught the error.



More information about the FRPythoneers mailing list