Using "pickle" for interprocess communication - some notes and things that ought to be documented.

Paul Boddie paul at boddie.org.uk
Fri Jan 18 17:54:05 EST 2008


On 18 Jan, 07:32, John Nagle <na... at animats.com> wrote:
>
>     "Processing" is useful, but it uses named pipes and sockets,
> not ordinary pipes.  Also, it has C code, so all the usual build
> and version problems apply.

The pprocess module uses pickles over sockets, mostly because the
asynchronous aspects of the communication only appear to work reliably
with sockets. See here for the code:

http://www.python.org/pypi/pprocess

Unlike your approach, pprocess employs the fork system call. In
another project of mine - jailtools - I use some of the pprocess
functionality with the subprocess module:

http://www.python.org/pypi/jailtools

I seem to recall that a few things are necessary when dealing with
subprocesses, especially those which employ the python executable:
running in unbuffered mode is one of those things.

Paul



More information about the Python-list mailing list