[Tutor] Output of os.system("c:\myprog.exe") "piped" to a pyt hon object ?

Doug Stanfield DOUGS@oceanic.com
Tue, 10 Oct 2000 07:04:33 -1000


Hi,

You don't indicate what platform you are running on.  The answer is =
somewhat
palatform dependant, but what you are looking for is popen() for "pipe
open".  If you are on a Unix system it and its cousins, popen2() and
popen3() work reliably.  On Windows there is a solution in the win32all
extensions by Mark Hammond.  I don't have any experience with it, but =
know
that it is named similarly.

Good luck,

-Doug-

If you need it and don't have it win32all is available from:

http://www.activestate.com/Products/ActivePython/win32all.html

> -----Original Message-----
> From: nicolas baurin [mailto:nicolas.baurin@univ-orleans.fr]
> Sent: Tuesday, October 10, 2000 6:45 AM
> To: tutor@python.org
> Subject: [Tutor] Output of os.system("c:\myprog.exe") "piped" to a
> python object ?
>=20
>=20
> Hello to everybody,
>=20
> clearly i'm using  os.system() to launch an external program=20
> ;i have to
> "redirect" what comes into the console  (standard output of=20
> the external
> program) towards a  python object: sys.stdout is not enough since =
it's
> applying to the python interpretor...
>=20
> Merci d'avances  et bonne soir=E9e,
>=20
> --
> Nicolas Baurin
>=20
> Doctorant
> Institut de Chimie Organique et Analytique, UPRES-A 6005
> http://www.univ-orleans.fr/SCIENCES/ICOA/
> Universit=E9 d'Orl=E9ans, BP 6759
> 45067 ORLEANS Cedex 2, France
> Tel: (33+) 2 38 49 45 77
>=20
>=20
>=20
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://www.python.org/mailman/listinfo/tutor
>=20