[IronPython] Running IronPython code from C#
f.cadier at free.fr
Wed Jul 12 16:03:40 CEST 2006
I had something working using IronPython.Runtime.OldClass and
IronPython.Runtime.OldInstance, but I don't even understand what i've
First, my IP script "ClassIP.py", defining a small class :
def __init__ (self, text):
self.text = text
return "Test " + self.text
And then a form with one TextBox in C# :
IronPython.Runtime.OldInstance current =
((IronPython.Runtime.OldClass)ClassIP.MyClass).Call("from C# !");
IronPython.Runtime.Method currentTest =
textBox1.Text = (string) currentTest.Call(current);
Is this something meaningful for you ?
Sanghyeon Seo a écrit :
> 2006/7/12, Frédéric Cadier <f.cadier at free.fr>:
>> I hope I won't be too annoying with a newbie question... but I'm
>> wondering how to run IP code from C# : I would for example define a
>> class MyClass in myclass.py, and want to instanciate it from some C# code.
> I believe this (defining CLS type in IronPython) is currently not
> possible, and it isn't planned for 1.0. That doesn't mean it won't be
> possible forever though.
> Seo Sanghyeon
> users mailing list
> users at lists.ironpython.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironpython-users