[PyQt] multiprocessing with QApplication

Jeremy Sanders jeremy at jeremysanders.net
Mon Jun 11 19:39:18 BST 2012


Luke Campagnola wrote:

> I agree with you about the multiprocessing package--I really only use it
> for the ease of passing python objects between processes. (I use
> multiprocessing.Pipe(), which I believe uses the Listener/Client system
> you mentioned). I'll definitely try using this with subprocess instead.
> Thanks for the EINTR warning; I'm sure that would have taken another hour
> or two for me to work out :)

I've had a lot of problems with multiprocessing, too, especially if combined 
with subprocess.

If you're interested, you could have a look the cross-process communication 
in veusz's embedding interface which uses sockets (sending pickled python 
objects). Pipes don't work very well with Windows as they're not proper file 
objects (you can't use QSocketNotifier on them).

Server end:
https://github.com/jeremysanders/veusz/blob/master/embed_remote.py

Client end:
https://github.com/jeremysanders/veusz/blob/master/embed.py

It's a bit tied in with the main program, but should be fairly clear.

Jeremy

-- 
http://www.jeremysanders.net/



More information about the PyQt mailing list