By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,050 Members | 1,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,050 IT Pros & Developers. It's quick & easy.

wxPython advice

P: n/a
vpr
Hi Guys

I have a question re. socketserver and wx.

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

Marinus

Oct 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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 <mt*****@qualcomm.com>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: GnuPT 2.7.2

iD8DBQFDXKpV8jAdENsUuJsRAvQeAJ44cOYRqWjhg6b62+rWCz JNdpYHOgCfaIes
LabC/xpe7kJTIWc/eaeWZYQ=
=8MXM
-----END PGP SIGNATURE-----

Oct 24 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.