473,472 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

catching traceback.print_exc()

Hi,

Is there a way to catch traceback.print_exc() output into a string ?
Philippe

Feb 23 '06 #1
2 2093
oops:

"""
format_exc( [limit[, file]])
This is like print_exc(limit) but returns a string instead of printing to a
file. New in version 2.4.
"""

Philippe Martin wrote:
Hi,

Is there a way to catch traceback.print_exc() output into a string ?
Philippe


Feb 23 '06 #2
Philippe Martin wrote:
Is there a way to catch traceback.print_exc() output into a string ?


Presumably using one of the alternatives, like format_exc(). If that's
not sufficient, maybe some example code to demonstrate what you really
want would help.

-Peter

Feb 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: fowlertrainer | last post by:
Hello python-list, This is a thread's run method. def run(self): try: page=urllib.urlopen(base) src=page.read() page=None self.ResultCode=0
6
by: EAS | last post by:
Hi, I'm wondering if there is any way to keep a program running when it runs into an error (using the 'try' structure) and print the traceback to the screen? Thanks.
1
by: Michael P. Soulier | last post by:
Hello, For a GUI app I've tried resetting sys.excepthook to my own exceptionhandler bound method, which accepts a type, value and traceback object. Now, the traceback module has print_exc...
3
by: Peter A. Schott | last post by:
I know there's got to be an easy way to do this - I want a way to catch the error text that would normally be shown in an interactive session and put that value into a string I can use later. I've...
5
by: Bob Greschke | last post by:
I want to cause any traceback output from my applications to show up in one of my dialog boxes, instead of in the command or terminal window (between running on Solaris, Linux, OSX and Windows...
4
by: billiejoex | last post by:
Hi there, I'm facing a case where I need to get the traceback outptut when occurring an exception. I solved such problem by using traceback module in conjunction with StringIO: import...
8
by: gregpinero | last post by:
I'm running code via the "exec in context" statement within a much larger program. What I would like to do is capture any possible errors and show a pretty traceback just like the Python...
2
by: Sami | last post by:
Hello, In the Python book that I am using to learn the language it says that the traceback.print_exc() can be used to stop exception propagation and make the program keep running. Here is a...
0
by: Gabriel Genellina | last post by:
En Mon, 26 May 2008 05:31:27 -0300, <Dominique.Holzwarth@ch.delarue.comescribió: Don't inherit from Exception - you should be able to log *any* exception, not only this specific one, I presume?...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.