[Python.NET] Unbound methods from a .net assembly

Shawn Edwards lesser.evil at gmail.com
Tue Apr 29 03:45:51 CEST 2008


D'oh!  I told you it was something stupid I was doing.

Thanks for the kick in the head.

On Mon, Apr 28, 2008 at 8:41 PM, Maksim Kozyarchuk <
mkozyarchuk at funddevelopmentservices.com> wrote:

>  Shawn,
>     GetAvailableDevices is a method, you should be calling it.
>
> I.e.
>     for r in QuickCam.GetAvailableDevices(): print r
>
> Maksim
>
>
> On 4/28/08 9:24 PM, "Shawn Edwards" <lesser.evil at gmail.com> wrote:
>
> I am trying to use the QuickCamLib library with Python.net.  I looks like
> I'm not getting the .net library loaded right, but I'm new to Python.net and
> to .net in general, so I'm not sure I'm doing everything right.
>
> The quickcamlib is here: http://grazz.com/projects/quickcamlib
>
> Here's what I get on the shell:
>
> Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
> (Intel)] on win32
> Type "copyright", "credits" or "license()" for more information.
>
>     ****************************************************************
>     Personal firewall software may warn about the connection IDLE
>     makes to its subprocess using this computer's internal loopback
>     interface.  This connection is not visible on any external
>     interface and no data is sent to or received from the Internet.
>     ****************************************************************
>
> IDLE 1.2.2
> >>> import clr
> >>> import QuickCamLib
> >>> from QuickCamLib import QuickCam
> >>> dir(QuickCam)
> ['Capture', 'Dispose', 'Equals', 'Finalize', 'Focus',
> 'GetAvailableDevices', 'GetAvailableResolutions', 'GetHashCode', 'GetType',
> 'MemberwiseClone', 'Pan', 'ReferenceEquals', 'ResetPTZ', 'Tilt', 'ToString',
> 'Zoom', '__call__', '__class__', '__cmp__', '__delattr__', '__delitem__',
> '__doc__', '__getattribute__', '__getitem__', '__hash__', '__init__',
> '__iter__', '__module__', '__new__', '__reduce__', '__reduce_ex__',
> '__repr__', '__setattr__', '__setitem__', '__str__']
> >>> QuickCam.GetAvailableDevices
> <unbound method 'GetAvailableDevices'>
> >>> for r in QuickCam.GetAvailableDevices: print r
>
>
> Traceback (most recent call last):
>   File "<pyshell#6>", line 1, in <module>
>     for r in QuickCam.GetAvailableDevices: print r
> TypeError: 'MethodBinding' object is not iterable
> >>> from System.Drawing import Point
> >>> p = Point(5,5)
> >>> print p
> {X=5,Y=5}
> >>>
>
> (the "Point" stuff is there to show that Python.net seems to work for some
> objects, just not others)
>
> The 'unbound method' message is worrisome.  Seems to me it should have
> done something instead of just complain that it is unbound.  Lazy binding
> isn't usually this lazy :)
>
> I don't know enough about .net to really test this library any other way,
> so it is also possible the library is dorked up somehow.
>
> If I need to send more/different data, please let me know.  Like I said,
> I'm new at a lot of this, so I'm likely missing something simple.
>
> Thanks in advance.
>
>
>


-- 
Shawn Edwards
Beware programmers with screwdrivers. Or, for that matter, any other mixed
drink.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20080428/787b7384/attachment.htm>


More information about the PythonDotNet mailing list