On Sunday 26 November 2006 16:17, John Fouhy wrote:
> On 27/11/06, johnf <[EMAIL PROTECTED]> wrote:
> > I can but it's not the issue - I think? I want to know how it works -
> > exceptions not handled by python that is. Are there exception handled
> > outside of python when using modules such as wxPython and pyQT? Or are
> > some exceptions not handled when running from the command line.
>
> If your GUI callbacks raise exceptions, the program may still function
> correctly.
>
> eg, basic Tkinter example (my Tkinter is a little rusty, so forgive
> errors):
>
> #####
> e = Entry(parent)
> e.pack()
>
> def clear():
> e.delete(0, END)
> raise ValueError
>
> b = Button(parent, label='Clear', command=clear)
> b.pack()
> #####
>
> The button will (I think) work correctly, and the program won't crash.
> But you should see the exception printed to the command line (if you
> run this program from a shell). I don't know for sure, but I imagine
> the Tkinter mainloop() does something like:
>
> try:
> callback()
> except:
> # print trace to stderr
>
> This is the only possibility I can think of at the moment. But there
> could be other things going on, which is why we'd like to see an
> example.
So there are outside exception handlers? OK. thanks for the answer. For now
that all I needed to understand.
--
John Fabiani
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor