threads and exception in wxPython

Jeff Shannon jeff at ccvcorp.com
Thu Nov 4 01:03:54 CET 2004


Josiah Carlson wrote:

>Zunbeltz Izaola <zunbeltz at wm.lc.ehu.es.XXX> wrote:
>  
>
>>If I put some code after the .start() method the queue will be
>>empty. Do I need to insert a infinite loop to see when the exception
>>is raised?
>>    
>>
>
>In your main thread (the one handling the GUI), you can set up a
>wx.Timer() whose bound event checks the queue every second or so.
>
>As another poster mentioned, you can also post events to the GUI, which
>can either say "there is an exception traceback in the queue" or "here
>is the exception traceback".
>  
>

Another possibility is to check the queue in an idle-event handler.  
When you place something in the queue, you can call wx.WakeUpIdle() to 
ensure that the main thread will do idle processing at its soonest 
opportunity.

Jeff Shannon
Technician/Programmer
Credit International




More information about the Python-list mailing list