[IronPython] Hosting question

Ryan Dawson rdawson at exchange.microsoft.com
Thu Jul 27 18:01:01 CEST 2006


Right, the Evaluate* methods are just for expressions.

Locally, I'm not seeing extra new lines being appended to the end of output.  That's not to say we don't have a bug here, we might.  Can you provide some more information?

This happens on a simple "print 3"?  We should be writing "3"+Environment.NewLine.  How are you reading from the memory stream?

Thanks,
        -Ryan


-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Slide
Sent: Thursday, July 27, 2006 7:17 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Hosting question

Yes and EvaluateXX methods throw an exception on something like

print "Hello, world"

because they are used to just evaluate expressions as far as I can tell.

The Execute method requires me to set standard output as I am doing to
with ExecuteToConsole.

Also, another question, when I am using the SetStandardOut and
friends, the output always have 4 newlines at the end, is there any
specific reason for this?

Thanks again

Alex

On 7/26/06, Martin Maly <Martin.Maly at microsoft.com> wrote:
> Have you tried using the PythonEngine.Evaluate, PythonEngine.Execute or PythonEngine.EvaluateAs<T> methods?
>
> Martin
>
> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Slide
> Sent: Wednesday, July 26, 2006 7:32 AM
> To: Discussion of IronPython
> Subject: [IronPython] Hosting question
>
> I have been playing around with embedding IronPython into an
> application to provide scripting support for my .NET application. One
> thing that I have noticed is that to get the output from the
> interpreter you have to use EvalToConsole. So to capture the input, I
> have to use SetStandardOut to some memory stream, etc, etc. I played
> with Boo prior to IronPython and they had a cool feature of the
> interactive interpreter where there was an event for when the
> interpreter printed something to its standard output, so to get the
> output it was as easy as adding an event handler to that event. Is
> there anything in the works like this, or should I just continue
> piping the output to a memory stream and go from there?
>
> Thanks
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list