[Tutor] IronPython any tutors with experience out there?

Alan Gauld alan.gauld at btinternet.com
Fri Jan 4 01:07:02 CET 2013


On 03/01/13 18:37, Bjorn Madsen wrote:

> However ... to interact with the c# modules which my colleagues wrote, I
> need to add "clr" references.
>
> Example:
>>>> import clr
>>>> clr.AddReferenceToFile("Mapack.dll")
>>>> from Mapack import *
>>>> dir()
>
> Unfortunately I can't get it to run

So does anything work? Is the import OK?
Are there any error messages?
Can you call any of the other CLR functions?
Can you  get a basic 'hello world' to run under .NET?

I've never used IronPython but I have played around
with C# and VB.Net on an earlier .NET framework (V2?)

There should be a bunch of functions you can access
via CLR, check that they work first to prove CLR
integration is OK.

For example can you use AddReference() to access
a standard  .NET assembly rather than AddReferenceToFile()
which is I assume for DLLs.

Finally there is an active gmane IronPython news group
which you could try for more focussed help...

gmane.comp.python.ironpython.user

It is probably sourced from the IronPython mailing
list of you prefer that...

http://mail.python.org/mailman/listinfo/ironpython-users

Finally I did find this reference:

http://stackoverflow.com/questions/3692539/clr-addreferencetofile-fails-in-ironpython-2-7

Which notes that you can only import DLLS compiled for .NET v4 in 
IronPython 2.7. Might that be the problem?


HTH
-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list