[IronPython] Need a Good Embedded Example

Dino Viehland dinov at exchange.microsoft.com
Wed Oct 17 00:19:34 CEST 2007


Yep, we've temporarily ripped out all pre-compilation support from v2.0 to make the refactoring work easier so pyc definitely won't work there (and there's really no way to make it work there w/o a rather large amount of work).

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Davy Mitchell
Sent: Tuesday, October 16, 2007 2:40 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Need a Good Embedded Example

Hi Dino,

Is this why I am having trouble with the pyc.py sample? It does say
1.01 in the description so maybe I should expect issues :-)

Traceback (most recent call last):
  File pyc.py, line 35, in Initialize
  File , line 0, in _stub_##227
AttributeError: 'NamespaceTracker' object has no attribute 'CompilerSink'

Thanks,
Davy

On 10/16/07, Dino Viehland <dinov at exchange.microsoft.com> wrote:
>
>
>
>
> Are you looking for samples in v1.0 or v2.0?  The code you quoted below is
> some version of v2.0 (we're still working on the final tweaks to what will
> become the new, final, hosting model).
>
>
>
>
> From: users-bounces at lists.ironpython.com
> [mailto:users-bounces at lists.ironpython.com] On Behalf Of
> Joshua J. Pearce
>  Sent: Tuesday, October 16, 2007 2:08 PM
>  To: users at lists.ironpython.com
>  Subject: [IronPython] Need a Good Embedded Example
>
>
>
>
>
> I have been looking for a good example of embedding IronPython in a c#
> application. I am under the impression that there have been some major
> changes in the way this is done from version 1.1 to 2.0.
>
>
>
>
>
> This is what I found at the Python Cookbook site:
>
>
>
>
>
> namespace IronPythonScriptHost
>  {
>      class Program
>      {
>          static void Main(string[] args)
>          {
>              string code = "print \"Hello \" + Name";
>              Script.SetVariable ("Name", "Me");
>              Script.Execute("py", code);
>          }
>      }
>  }
>
>
>
>
>
> That's nice, but doesn't really help me to know how to get variable output
> from the script back to my c# code. I also need to know how to call scripts
> with multiple statements and whether all variables need to be set on the
> script object, or can their declaration just be part of the script code.
>
>
>
>
>
> Is there a good and simple example anywhere that shows how to host the
> IronPython engine in a c# app and let users manipulate your program objects
> via ipy scripts?
>
>
>
>
>
> Thanks!
>
>  --
>  Joshua Pearce
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>


--
Davy Mitchell
Blog - http://www.latedecember.co.uk/sites/personal/davy/
Twitter - http://twitter.com/daftspaniel
Skype - daftspaniel
needgod.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