|
Okay, so I need to call a Python COM object from MATLAB. I can do it from Excel just fine, but when I use ACTXSERVER it seems to load it but when queried for methods and other things it just seems to be empty.
In MATLAB I type the call below to get a handle h to the Python object (the Python code is at the end of the post)
>> h = actxserver('python.try2')
h =
COM.python_try2
when I use the methods function to see what methods the object has, I only get the MATLAB ones:
>> methods(h)
Methods for class COM.python_try2:
addproperty deleteproperty interfaces move save
constructorargs events invoke propedit send
delete get load release set
This is the Python test code:
class PythonUtilities:
_public_methods_ = ['hello']
_reg_progid_ = "Python.Try2"
_reg_clsid_ = "{19353e9b-964a-4b1c-8cd1-baccc0209af3}"
def hello(self, string):
return string
if __name__=='__main__':
print "Registering COM server..."
import win32com.server.register
win32com.server.register.UseCommandLine(PythonUtilities)
Any ideas are welcome, at the very least, thanks for reading this post.
-Santiago
|