In article <[EMAIL PROTECTED]>,
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> En Fri, 02 Mar 2007 14:38:59 -0300, Donn Cave <[EMAIL PROTECTED]>
> escribió:
>
> > In article <[EMAIL PROTECTED]>,
> > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> >
> >> On http://docs.python.org/lib/popen2
En Fri, 02 Mar 2007 14:38:59 -0300, Donn Cave <[EMAIL PROTECTED]>
escribió:
> In article <[EMAIL PROTECTED]>,
> "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
>
>> On http://docs.python.org/lib/popen2-flow-control.html there are some
>> notes on possible flow control problems you may encounter.
In article <[EMAIL PROTECTED]>,
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> En Thu, 01 Mar 2007 14:42:00 -0300, <[EMAIL PROTECTED]> escribió:
>
> > BUT If I use PIPE for both (so I can .write() on the stdin and .read()
> > from the subprocess' stdout stream (better: file descriptor)) readin
[EMAIL PROTECTED] writes:
> So, once I start the C Program from the shell, I immediately get its
> output in my terminal. If I start it from a subprocess in python and
> use python's sys.stdin/sys.stdout as the subprocess' stdout/stdin I
> also get it immediately.
If stdout is connected to a term
> If you are both waiting for input, you have a Mexican standoff...
That is not the problem. The problem is, that the buffers are not
flushed correctly. It's a dialogue, so nothing complicated. But python
does not get what the subprocess sends onto the subprocess' standard
out - not every time, an
<[EMAIL PROTECTED]> wrote:
8<--
> The C programm gets its "commands" from its stdin and sends its state
> to stdout. Thus I have some kind of dialog over stdin.
>
> So, once I start the C Program from the shell, I immediately get its
> output in my terminal. If I start it from a
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> Thanks for your answer. I had a look into the fcntl module and tried
> to unlock the output-file, but
>
> >>> fcntl.lockf(x.stdout, fcntl.LOCK_UN)
> Traceback (most recent call last):
> File "", line 1, in
> IOError: [Errno 9] Bad file descriptor
>
> I
En Thu, 01 Mar 2007 14:42:00 -0300, <[EMAIL PROTECTED]> escribió:
> BUT If I use PIPE for both (so I can .write() on the stdin and .read()
> from the subprocess' stdout stream (better: file descriptor)) reading
> from the subprocess stdout blocks forever. If I write something onto
> the subprocess
[EMAIL PROTECTED] wrote:
> Okay, here is what I want to do:
>
> I have a C Program that I have the source for and want to hook with
> python into that. What I want to do is: run the C program as a
> subprocess.
> The C programm gets its "commands" from its stdin and sends its state
> to stdout. Th
Okay, here is what I want to do:
I have a C Program that I have the source for and want to hook with
python into that. What I want to do is: run the C program as a
subprocess.
The C programm gets its "commands" from its stdin and sends its state
to stdout. Thus I have some kind of dialog over stdi
En Wed, 28 Feb 2007 18:27:43 -0300, <[EMAIL PROTECTED]> escribió:
> Hi,
>
> I am trying to communicate with a subprocess via the subprocess
> module. Consider the following example:
>
from subprocess import Popen, PIPE
Popen("""python -c 'input("hey")'""", shell=True)
>
hey
>
> Her
Hi,
Thanks for your answer. I had a look into the fcntl module and tried
to unlock the output-file, but
>>> fcntl.lockf(x.stdout, fcntl.LOCK_UN)
Traceback (most recent call last):
File "", line 1, in
IOError: [Errno 9] Bad file descriptor
I wonder why it does work with the sys.stdin It's real
<[EMAIL PROTECTED]> wrote:
> Is it possible to read to and write to the std streams of a
> subprocess? What am I doing wrong?
I think this problem lies deeper - there has been a lot of
complaints about blocking and data getting stuck in pipes
and sockets...
I have noticed that the Python file o
Hi,
I am trying to communicate with a subprocess via the subprocess
module. Consider the following example:
>>> from subprocess import Popen, PIPE
>>> Popen("""python -c 'input("hey")'""", shell=True)
>>> hey
Here hey is immediately print to stdout of my interpreter, I did not
type in the "hey"
14 matches
Mail list logo