[IronPython] Using a Python-Module from other Languages over .NET?

Michael Foord fuzzyman at voidspace.org.uk
Sun Feb 18 14:35:30 CET 2007


kls wrote:
> Hi,
>
> i have a litle question: Is it possibel to compile a Python-Module with 
> IronPython with all dependencies to a .Net-Module with can used from 
> other Languages like VB over .NET?
>
>   
Not directly I'm afraid.

The .NET garbage collector doesn't collect classes, so for memory 
efficiency reasons (? - only ?) IronPython re-uses a single (?) class 
definition internally.

That means that IronPython classes can't be consumed directly from other 
languages.

You can create stub wrapper classes in C# / VB.NET which call into the 
engine and use your classes. This is quite simple and somewhere on this 
list someone posted an example.

Using the System.Reflection API it should be possible to automate 
creating these stub classes. I haven't had time to explore this myself, 
but it would be very interesting.

All the best,

Michael Foord
http://www.voidspace.org.uk/ironpython/



> Thx for the answers
> _______________________________________________
> 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