Somebody just wanted to run wxPython asynchronously

David Bolen db3l at fitlinxx.com
Tue Nov 13 14:57:02 EST 2001


Laura Creighton <lac at strakt.com> writes:

> and I just went and deleted that piece of mail because I am an idiot,
> so I can't put this in the correct thread.
> 
> And I have no idea who it was, etc.
> 
> but use this:
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82965
> 
> 
> change the Tkinter references to your equivalent wxPython ones.
> 
> There is nothing in this that requires Tkinter.

Or as an alternative, I'd probably suggest posting an event to the
main GUI thread when something was available (either that the queue
has an element or to eliminate the use of the queue entirely) rather
than making the main thread poll 10x/s to see if there is something
available.  Less overhead that way.

Some other examples of methods of having a long running background
task interacting with a primary GUI thread in wxPython can also be
found at http://wiki.wxpython.org/index.cgi/LongRunningTasks

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list