wxPython advice

Miki Tebeka mtebeka at qualcomm.com
Mon Oct 24 11:33:09 CEST 2005


Hello vpr,

> I've written a p2p program using socketserver that's nice and quick.
> I'd like to give the user a tray applet (part of the p2p service) that
> will allow the user to activate / deactivate / config and exit the
> service.
> However I'm starting to bang my head on the mainloop funtions that
> manage
> wx and socket events.
> 
> Anyone been down this road that can give me some advice
One common solution is to do all the work in a "worker thread" and keep the
GUI responsive to command.

Note that Python don't have native support to pause/resume threads. You'll
need to get your thread to check for new state every now and then. (Usually
this means keep transactions small) or use processes instead of threads
(see http://home.pacbell.net/ouster/threads.pdf).

You might want to use async socket reading as well.

HTH.
--
------------------------------------------------------------------------
Miki Tebeka <mtebeka at qualcomm.com>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 215 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20051024/f98c15c6/attachment.pgp>


More information about the Python-list mailing list