On Feb 22, 12:15 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Thu, 21 Feb 2008 12:34:28 -0800 (PST), "[EMAIL PROTECTED]"
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
>
>
> > I'm opening up a subprocess like this where slave.py is a text based
> > app that receives commands and responds with output:
>
> > r, w, e = popen2.popen3('python slave.py')
>
> > I need to send slave.py a command and see the output,
> > so I'll do something like:
>
> > w.write("command here")
> > then i'll try this:
> > w.flush()
>
> > A separate thread is reading from r to retrieve output of slave.py.
>
> > The problem is that slave.py doesn't seem to receive commands unless I
> > also do:
> > w.close()
>
> What happens if you do:
>
> w.write("command here\n")
> w.flush()
>
> Could the slave be blocked waiting for an EOL character before
> processing said command?
> --
> Wulfraed Dennis Lee Bieber KD6MOG
> [EMAIL PROTECTED] [EMAIL PROTECTED]
> HTTP://wlfraed.home.netcom.com/
> (Bestiaria Support Staff: [EMAIL PROTECTED])
> HTTP://www.bestiaria.com/
I don't think that is the problem, I'm feeding it newline characters.
--
http://mail.python.org/mailman/listinfo/python-list