[IronPython] Redirecting input/output in IronPython 2.x

Dino Viehland dinov at exchange.microsoft.com
Thu Apr 17 20:07:42 CEST 2008


You want ScriptRuntime.IO.SetOutput/ScriptRuntime.IO.SetError which will let you set the I/O used for all the ScriptEngine's running in the given ScriptRuntime.  You also now need to provide either a Stream and an Encoding or a Stream and a TextWriter.  The reason for that is to support both text and binary output for scenarios such as PHP wanting to print a JPG.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of David Seruyange
Sent: Thursday, April 17, 2008 10:59 AM
To: IronPython IronPython
Subject: [IronPython] Redirecting input/output in IronPython 2.x

Hey everyone,

looking at a lot of the samples online I see the following:


      pythonEngine.SetStandardError(s);

      pythonEngine.SetStandardOutput(s);
where s is some stream. The Python Engine doesn't seem to support that method when I make a reference to IronPython 2.0. Am I missing something or are the online resources now obsolete?

Thanks much -

David

________________________________
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.<http://us.rd.yahoo.com/evt=51733/*http:/mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ%20>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080417/7836ea5e/attachment.html>


More information about the Ironpython-users mailing list