On Nov 26, 7:58 pm, "Dan Upton" <[EMAIL PROTECTED]> wrote: > I have a Python script that does a fork/exec, so the parent process > can get the child's PID and monitor /proc/PID/stat (on a CentOS > system). Most of my processes' command lines are straightforward > enough to do this with, but I have a handful that use < on the command > line, eg > > ./gobmk_base.linux_x86 --quiet --mode gtp < 13x13.tst > > The only thing I could really think of to try was > > os.execv("./gobmk_base.linux_x86", ["./gobmk_base.linux_x86", > "--quiet", "--mode", "gtp", "<", "13x13.tst"]) > > but this apparently doesn't work. Is there some other way to > accomplish what I'm going for? > > Thanks, > -dan
IIRC, if os.fork() == 0: new_stdin = os.open('13x13.tst') os.dup2(new_stdin, sys.stdin.fileno()) os.close(new_stdin) os.execv("./gobmk_base.linux_x86", ["./gobmk_base.linux_x886", "-- quiet", "--mode", "gtp"]) -- http://mail.python.org/mailman/listinfo/python-list