[python-win32] dispatch tuple

Janez Jere janez.jere at void.si
Tue Aug 5 02:44:37 EDT 2003


Hello pycom wizards!

is it posible to write such an object that its method will return a tuple to
it caller. In my case ideal output (x)
would be x == (1234, 4321)

import win32com.server.util, win32com.client
class C:
    _public_methods_ = ['foo']
    _com_interfaces_ = []
    def foo(self):
        return (1234,4321)


ow = win32com.server.util.wrap(C() )
o = win32com.client.Dispatch(ow)

x =  o.foo()
print 'type', type(x)
print x
=============
output:
type <type 'int'>
1234


Janez




More information about the Python-win32 mailing list