Lars Kotthoff wrote:
This prints out "foo" twice although it's only written once to the pipe. It
seems that python doesn't flush file descriptors before copying them to the
child process, thus resulting in the duplicate message. The equivalent C
program behaves as expected,
Your Python and C p
В Втр, 09/12/2008 в 19:26 +, Lars Kotthoff пишет:
> Dear list,
>
> I recently noticed a python program which uses forks and pipes for
> communication between the processes not behaving as expected. The minimal
> example program:
If you write
r, w = os.pipe()
os.write(w, 'foo')
pid = os
On Dec 9, 2008, at 2:26 PM, Lars Kotthoff wrote:
Dear list,
I recently noticed a python program which uses forks and pipes for
communication between the processes not behaving as expected. The
minimal
example program:
[snip]
This prints out "foo" twice although it's only written once to
Dear list,
I recently noticed a python program which uses forks and pipes for
communication between the processes not behaving as expected. The minimal
example program:
#!/usr/bin/python
import os, sys
r, w = os.p