By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,001 Members | 1,176 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,001 IT Pros & Developers. It's quick & easy.

Python exception hook simple example needed

P: n/a
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
Jul 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Am Tue, 05 Jul 2005 16:07:44 +0200 schrieb fo***********@anonym.hu:
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
--
Thomas GŁttler, http://www.thomas-guettler.de/
Jul 21 '05 #2

P: n/a
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.

http://zephyrfalcon.org/labs

Best Regards,

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

Jul 21 '05 #3

P: n/a
On Jul 6, 2005, at 8:59 AM, Fuzzyman wrote:
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/

Jul 21 '05 #4

P: n/a
Do you have an exception handling dialog ?

Can you use the UI layer without being tied to the rest of the
framework ? They seemed pretty integrated to me.

Best Regards,

Fuzzy
http://www.voidspace.org.uk/pythonhave an

Jul 21 '05 #5

P: n/a
On Jul 7, 2005, at 7:27 AM, Fuzzyman wrote:
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/

Jul 21 '05 #6

P: n/a


Ed Leafe wrote:
On Jul 7, 2005, at 7:27 AM, Fuzzyman wrote:
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?


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

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/


Jul 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.