redirecting messgaef from sys.stdout

harold fellermann harold.fellermann at upf.edu
Tue Jun 7 10:55:51 EDT 2005


On 07.06.2005, at 16:43, Ahmad Hosseinzadeh wrote:

> Hello,
>
> I’m trying to run an external program in my
> application. Both are coded in python. I need to write
> an independent module that is used in the main
> application. Its responsibility is to run the external
> program and redirect its stdout and stderr to the main
> application.
> The application’s stdout and stderr are set to an
> object and they are not command prompt anymore.
> The output is selected by a flag; if true the stdout
> and stderr will be redirected to application’s stdout
> and stderr. If false, the stdout and stderr will be
> redirected o command prompt. I don’t know how to
> redirect the output.
> Can anyone help please?

have a look at:
http://www.python.org/doc/current/lib/module-popen2.html

--
Je me suis enfermé dans mon amour -- je rève.
-- Paul Eluard




More information about the Python-list mailing list