Python exception hook simple example needed

F

fowlertrainer

Hi !

I wrote some mails to wxPy, and this list about "wxPython and global
exception handling" theme.
I need to port my Delphi apps to wxPy, and I want to use same exception
mechanism like Delphi use.

When any exception get unhandled, the app's main cycle get it, and show
in a dialog (and I can catch it, and I can write it to a log file with
many developer information).

So: I need to create this in wx+Py.

But my computer crashed yesterday, some local emails, files deleted, etc...

If anyone has an idea, how to I catch exceptions globally, please write me.

I think they are wrote about Python exception hook...
If you have a simple example how to use it, write to me !

Thanx for your help: ft
 
T

Thomas Guettler

Am Tue, 05 Jul 2005 16:07:44 +0200 schrieb (e-mail address removed):
Hi !

I wrote some mails to wxPy, and this list about "wxPython and global
exception handling" theme.
I need to port my Delphi apps to wxPy, and I want to use same exception
mechanism like Delphi use.

When any exception get unhandled, the app's main cycle get it, and show
in a dialog (and I can catch it, and I can write it to a log file with
many developer information).

Hi,

maybe a look at the "cgitb" module helps you. It uses an exception handler
to create a HTML page if an uncaught exception is raised.

HTH,
Thomas
 
E

Ed Leafe

Wax has a brilliant prebuilt dialog/handler. It's a wrapper over
wxPython - so you still use wxPython objects, it's jsut all a lot
easier.

And don't forget Dabo, which wraps all of wxPython's dialogs into
simple calls. No need to create/show/destroy; just call the appropriate
function.

I know I'm biased, being one of the authors, but I've used both
extensively, and find Dabo so much easier to work with. And if there's
a part of wxPython that we haven't wrapped yet, let us know, as we are
actively working on Dabo and improving it all the time.

___/
/
__/
/
____/
Ed Leafe
http://leafe.com/
http://dabodev.com/
 
E

Ed Leafe

Do you have an exception handling dialog ?

Not per se, as there hasn't been a request for one; we have several
dialogs ranging from simple messages to alerts to interactive dialogs,
much as wxPython offers. But I'll make this offer: give me a spec as to
what you need this "exception handling dialog" to do, and I'll have it
added to the framework within 24 hours. Deal?
Can you use the UI layer without being tied to the rest of the
framework ? They seemed pretty integrated to me.

They are integrated, but nothing forces you to use anything you don't
want. I know of several people who have developed UI-only apps, with no
need for business objects or database connectivity. They started in
plain wxPython, and switched to Dabo because it was so much easier, and
so much more Pythonic.

___/
/
__/
/
____/
Ed Leafe
http://leafe.com/
http://dabodev.com/
 
F

Fuzzyman

Ed said:
Not per se, as there hasn't been a request for one; we have several
dialogs ranging from simple messages to alerts to interactive dialogs,
much as wxPython offers. But I'll make this offer: give me a spec as to
what you need this "exception handling dialog" to do, and I'll have it
added to the framework within 24 hours. Deal?

Hello Ed,

It's a brilliant offer - and dabo sounds very interesting.
I was responding to someone else's question though ! Next time I need
to code a GUI app I'll take a look at dabo.

Thanks
Fuzzy
http://www.voidspace.org.uk/python
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top