Python COM and variable number of arguments

Greg Green gregory.p.green at boeing.com
Thu Sep 19 23:36:25 CEST 2002


I am using python with a third-party closed source application. It has
Visual Basic for Applications embedded in it for use as an extension
language. My question is what to do about com calls that have a
variable number of arguments in Visual Basic. It seems that I have to
use all of the arguments when I call the method using python. But I
don't know what to use for a value when I don't want that argument.

For instance, In VB i can call the method .Add with 1, 2, or 3
arguments. The 2nd and 3rd arguments are optional. In this case the
2nd argument is called 'Before', and the 3rd is 'After'. So if I want
to add an item after the 3rd item. I do: 

        .Add(Item,,3) 

In python I don't know what to use as the second argument:

        Object.Add(Item=Item,Before=????,After=3)

In case you are wondering, I have tried 'None', or leaving off the
argument all together, but that doesn't work. :(

Thanks for any replies. This is causing me a lot of pain.

-- 

Greg Green




More information about the Python-list mailing list