我试过这个:
class A(IntelliCAD.IIcadApplication):
def __init__(self):
self = (win32com.client.Dispatch('Icad.Application'))
print dir(self)
a = A()
print dir(a)
并得到以下输出:
['CLSID', 'DefineFunction', 'GetInterfaceObject', 'Help',
'IsFunctionLoaded', 'ListSDS', 'LoadDVB', 'LoadLISP', 'LoadSDS',
'Quit', 'RunCommand', 'RunMacro', 'RunScript', 'UndefineFunction',
'UnloadDVB', 'UnloadSDS', '_ApplyTypes_', '__doc__', '__eq__',
'__getattr__', '__init__', '__module__', '__ne__', '__repr__',
'__setattr__', '_get_good_object_', '_get_good_single_object_',
'_oleobj_', '_prop_map_get_', '_prop_map_put_', 'coclass_clsid']
['CLSID', 'DefineFunction', 'GetInterfaceObject', 'Help',
'IsFunctionLoaded', 'ListSDS', 'LoadDVB', 'LoadLISP', 'LoadSDS',
'Quit', 'RunCommand', 'RunMacro', 'RunScript', 'UndefineFunction',
'UnloadDVB', 'UnloadSDS', '_ApplyTypes_', '__doc__', '__eq__',
'__getattr__', '__init__', '__module__', '__ne__', '__repr__',
'__setattr__', '_get_good_object_', '_get_good_single_object_',
'_prop_map_get_', '_prop_map_put_', 'coclass_clsid']
唯一的区别_oleobj_
是不知何故丢失了。我究竟做错了什么?