Re: Python Embedding: redirecting output

Dag Gruneau (dg@preseco.comm.se)
9 Feb 1995 08:09:47 GMT

montyb@hks.com (Monty Brandenberg) wrote:
>
> I'm busy embedding Python into a distributed application environment
> and I need to gather up Python's normal and exceptional text output
> and return it to the application's front end as part of a command's
> return value.

Changing sys.stderr and sys.stdout works well with all Python
generated output. But the interpreter itself can produce error
messages on stderr that you might want to catch. These messages
are internal error messages and will not occur under normal conditions.

To catch the internal messages I redirected stderr to a file
so I know I will get the message in case anything appears.

On contract now, real adress:
-----------------------------o----------------------------------------------
Dag Gruneau \ 0 Voice: +46 (0)708 87 46 85
TeleTalk AB \_| Fax: +46 (0)8 31 31 34
Box 6342 \---------\---------/ Mail: dag.gruneau@teletalk.se
S102 35 Stockholm ^^^^^^^^^^^^^^0^^^^^^^^^^^^ NeXT mail, MIME
Sweden
----------------------------------------------------------------------------