[IronPython] call .net module from ironPython
Curt Hagenlocher
curt at hagenlocher.org
Fri Jun 11 17:40:07 CEST 2010
I created a project VbClassLibrary which contains a public module Module1.
The module contains a public function GetMaxIdentifier. From IronPython 2.6,
I say
IronPython 2.6 (2.6.10920.0) on .NET 4.0.30319.1
Type "help", "copyright", "credits" or "license" for more information.
>>> import clr
>>> clr.AddReference('VbClassLibrary')
>>> from VbClassLibrary import Module1
>>> Module1.GetMaxIdentifier
<built-in function GetMaxIdentifier>
>>> Module1.GetMaxIdentifier(2)
4
>>>
So there doesn't seem to be a general problem accessing functions in
VB.NETmodules.
On Fri, Jun 11, 2010 at 12:59 AM, Nico Picavet <nico at ramasoft.com> wrote:
> Hi there,
>
> I run python scripts from within a vb.net sollution.
> I can add references to our dll's and call all classes, functions, subs
> etc. but now I run into a specific problem.
> In one of our dll's we have a module 'scriptutills' with a public function
> 'GetMaxIdentifier'that returns a unique number as a sort of identifier for a
> new project.
> I can add a reference to the containing dll but when I call
> scriptutills.'GetMaxIdentifier'() I get an error "'type' object has no
> attribute 'GetMaxIdentifier'"
> If I change the module into a class with the same subs, I càn call the
> 'GetMaxIdentifier' function without any problems. Does anybody has a
> sollution for this?
> Thanks a lot.
>
> Nico
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100611/c119db3e/attachment.html>
More information about the Ironpython-users
mailing list