[wxPython-users] Learning WxPython threading

Josiah Carlson jcarlson at uci.edu
Mon Jan 1 04:17:38 PST 2007


Richie Ward <richie at lucnetsolutions.com> wrote:
> 
> I am trying to learn Threading in WxPython... argh I hate threads in 
> alot of languages but im determined to beat them! Python looks promising 
> though!
> 
> I am reading this: http://wiki.wxpython.org/index.cgi/LongRunningTasks
[snip]
> I want to split that file into a few modules... something like this:
[snip]
> Im not quite sure how to fix it but I know why... the EVT_RESULT_ID 
> variable isnt getting to the other modules... i need to make this 
> variable accessable to all the threads and classes.

See the Python tutorial on module/package namespaces:
http://docs.python.org/tut/node8.html

You also may want to take a look at:
http://wiki.wxpython.org/index.cgi/AsynchronousSockets

Which shows the updated way of creating and using new event types, both
from a the GUI thread and from an optional secondary thread.  Which
reminds me that someone should update the wiki to use more up-to-date
patterns.

 - Josiah





More information about the wxpython-users mailing list