Thanks /F, that was it.
Dan
On Sat, 18 Nov 2006 15:03:30 +0100, Fredrik Lundh
<[EMAIL PROTECTED]> wrote:
[snip]
>p.stdin is the *other* process' stdin. if you want to read things it
>prints, read from p.stdout instead.
>
>> print fin.readline()
>> fin.close()
>
>
--
http://mail.python.org/m
Daniel Klein wrote:
> Now here is my attempt to use the 'subprocess' module :
>
> from subprocess import *
> p = Popen(r'c:\home\hw.exe', bufsize=-1, stdin=PIPE, stdout=PIPE,
> universal_newlines=True)
> fin = p.stdin
p.stdin is the *other* process' stdin. if you want to read things it
prints,
Daniel Klein wrote:
> Here's a c routine that prints a single line :
>
> #include
> main()
> {
> printf ("Hello World!\n");
> }
>
> And now the Python program (called 'po.py') that uses 'popen2' :
>
> import popen2
> (fin, fout) = popen2.popen2(r'c:\home\hw.exe', -1, 't')
> print fin.readline()
Here's a c routine that prints a single line :
#include
main()
{
printf ("Hello World!\n");
}
And now the Python program (called 'po.py') that uses 'popen2' :
import popen2
(fin, fout) = popen2.popen2(r'c:\home\hw.exe', -1, 't')
print fin.readline()
fin.close()
fout.close()
When this is run