portable fork+exec/spawn

Jean-Paul Calderone exarkun at divmod.com
Fri May 2 10:48:18 EDT 2008


On Fri, 02 May 2008 06:30:03 -0500, Nick Craig-Wood <nick at craig-wood.com> wrote:
>Brendan Miller <catphive at catphive.net> wrote:
>>  On Fri, 02 May 2008 13:25:55 +1000, Ben Finney wrote:
>>
>> > URL:http://docs.python.org/lib/module-subprocess.html
>>
>>  Awesome. This is exactly what I was hoping existed.
>
>subprocess works well for spawn process, send input, receive output,
>read exit code type jobs.
>
>For jobs which require interactivity ie send input, receive output,
>send input, receive output, ... it doesn't work well.  There isn't a
>good cross platform solution for this yet.  pyexpect works well under
>unix and is hopefully being ported to windows soon.

I haven't read all of this thread, so excuse me if this is out of place.

There is a good cross-platform solution, in fact.  It's Twisted's
spawnProcess API, which works on POSIX and Windows, supports supports
sending and receiving, and doesn't have deadlock issues since it's
event-driven.

Jean-Paul



More information about the Python-list mailing list