Win32com Item method does not return object

Mark_Pryor erlangen72 at hotmail.com
Mon Jun 18 23:33:23 EDT 2001


Mark Hammond wrote in message <3B2EBBE7.8050803 at ActiveState.com>...
>Mark_Pryor wrote:
>
>> Hi,
>> 
>> New to Python, using Version 2.1 on Win95.
>> I have a COM object that has been registered into
>> the gen_py folder. As I drill down through the object, I
>> issue the Item method of a collection, which should return
>> another collection, but fails returning a " tuple ".
>
>
>PythonCOM returns a tuple when there are multiple return values from the 
>function - typically byref params.
>
>>>>>c = om.Tags.Item(1)
>
>
>My guess is that for some reason, the Item method takes the int param byref.
>
>But without seeing that C actually is, it is hard to speculate, but your 
>best bet may be to write it as:
>
>c, ignored = om.Tags.Item(1)

 That's it, your speculation nailed it.
c returned this way is now a Tag object, as expected. I get the drop down
again and can continue on.

Thanks Mark !

>
>Mark.
>
>




More information about the Python-list mailing list