Hi there,
I can easily use the subprocess module to run a separate exe from within
MyScript.py..
 
e.g.
import subprocess
process=subprocess.Popen("myprog.exe -i inputfile.txt -o
outputfile.txt")
 
..and that's just fine as far as it goes, if I don't mind creating
'inputfile.txt' first, and reading 'outputfile.txt' afterward.
 
But what if I do mind? I'm trying to do something like..
 
stdin="my input string"
process=subprocess.Popen("myprog.exe -i stdin -o stdout") # (infact
these are the default args for -i and -o, so it seems like myprog.exe
can be used this way)
myresults=stdout
 
I just can't wrap my head around stdin, stdout and the whole pipes
thing, but there's got to be a relatively simple way to do this, surely?
 
 
thanks for any help,
Dave (relative newbie using PythonWin & Python 2.4)

This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to