[Python.NET] Using a .Net DLL

Sean McKay mckay_sean at yahoo.com
Fri Mar 12 17:05:22 EST 2004


Thane,

I figured out the problem.. it turns out that I had an old version of the
DLL in the GAC (and at one point an old one copied to the Python.Net
directory).. when I updated the GAC (and deleted the one in the Python.Net
directory) I was able to successfully initialize the Set object.

Thanks for looking into this.  I wouldn't have figured it out if you
hadn't shown it working on your box!

Sean

--- Thane <thane at magna-capital.com> wrote:
> Code is good.  See output below.  I suspect that Python.NET can't see
> something...
> 
> I'll keep playing with it and try to duplicate your error.
> 
> --Thane
> 
> -----------  PYTHON OUTPUT -----------------
> Python 2.3.2 (#49, Oct  2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on
> win32
> Type "copyright", "credits" or "license" for more information.
> >>> Running initialization script, please stand by...
> >>> import CLR.nltk
> >>> from CLR.nltk import Set
> >>> dir(Set)
> ['__doc__', '__name__']
> >>> from CLR.nltk.Set import Set
> >>> dir(Set)
> ['Equals', 'Finalize', 'GetHashCode', 'GetType', 'MemberwiseClone',
> 'ReferenceEquals', 'ToString', '__and__', '__call__', '__class__',
> '__cmp__', '__contains__', '__delattr__', '__delitem__', '__doc__',
> '__eq__', '__getattribute__', '__getitem__', '__hash__', '__init__',
> '__iter__', '__len__', '__module__', '__new__', '__or__', '__reduce__',
> '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str__',
> '__sub__', 'contains', 'copy', 'count', 'dict', 'difference',
> 'elements',
> 'f_measure', 'intersection', 'precision', 'recall', 'union']
> >>> a = Set(1)
> Traceback (most recent call last):
>   File "<console>", line 1, in ?
> TypeError: no constructor matches given arguments
> >>> a = Set([1,2])
> >>> a
> <CLR.nltk.Set.Set object at 0x072A7BD0>
> >>> b = Set([5,3,2,1])
> >>> b
> <CLR.nltk.Set.Set object at 0x072A7D30>
> >>> b.contains(3)
> True
> >>>  
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html



More information about the PythonDotNet mailing list