The Python help function can be used to show the methods and properties of a COM interface, showing docstrings when they are available:
>>> from comtypes.client import CreateObject
>>> engine = CreateObject("MSScriptControl.ScriptControl")
>>> help(engine)
Help on POINTER(IScriptControl) in module comtypes object:
class POINTER(IScriptControl)(comtypes.gen._0E59F1D2_1FBE_11D0_8FF2_00A0D10038BC_0_1_0.IScriptControl, POINTER(IDispatch))
| Method resolution order:
| POINTER(IScriptControl)
| comtypes.gen._0E59F1D2_1FBE_11D0_8FF2_00A0D10038BC_0_1_0.IScriptControl
| POINTER(IDispatch)
| comtypes.automation.IDispatch
| POINTER(IUnknown)
| IUnknown
| _compointer_base
| ctypes.c_void_p
| _ctypes._SimpleCData
| _ctypes._CData
| __builtin__.object
|
| Methods defined here:
|
| __getattr__(self, name)
| Implement case insensitive access to methods and properties
|
| __setattr__(self, name, value)
| Implement case insensitive access to methods and properties
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __com_interface__ = <class 'comtypes.gen._0E59F1D2_1FBE_11D0_8FF2_00A0...
|
|
| ----------------------------------------------------------------------
| Methods inherited from comtypes.gen._0E59F1D2_1FBE_11D0_8FF2_00A0D10038BC_0_1_0.IScriptControl:
|
| AddCode(...)
| Add code to the global module
|
| AddObject(...)
| Add an object to the global namespace of the scripting engine
|
| Eval(...)
| Evaluate an expression within the context of the global module
|
| ExecuteStatement(...)
| Execute a statement within the context of the global module
|
| Reset(...)
| Reset the scripting engine to a newly created state
|
| Run(...)
| Call a procedure defined in the global module
|
| ----------------------------------------------------------------------
| Data descriptors inherited from comtypes.gen._0E59F1D2_1FBE_11D0_8FF2_00A0D10038BC_0_1_0.IScriptControl:
|
| AllowUI
| Enable or disable display of the UI
|
| CodeObject
| Object exposed by the scripting engine that contains methods and properties defined in the code added to the global module
|
| Error
| The last error reported by the scripting engine
|
| Language
| Language engine to use
|
| Modules
| Collection of modules for the ScriptControl
|
| Procedures
| Collection of procedures that are defined in the global module
|
| SitehWnd
| hWnd used as a parent for displaying UI
|
| State
| State of the control
|
| Timeout
| Length of time in milliseconds that a script can execute before being considered hung
|
| UseSafeSubset
| Force script to execute in safe mode and disallow potentially harmful actions
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from comtypes.gen._0E59F1D2_1FBE_11D0_8FF2_00A0D10038BC_0_1_0.IScriptControl:
|
| __map_case__ = {'_aboutbox': '_AboutBox', '_get_allowui': '_get_AllowU...
|
| ----------------------------------------------------------------------
| Methods inherited from POINTER(IDispatch):
|
| __ctypes_from_outparam__ = wrap_outparam(punk)
|
| ----------------------------------------------------------------------
| Methods inherited from comtypes.automation.IDispatch:
|
| GetIDsOfNames(self, *names, **kw)
| Map string names to integer ids.
|
| GetTypeInfo(self, index, lcid=0)
| Return type information. Index 0 specifies typeinfo for IDispatch
|
| GetTypeInfoCount(...)
|
| Invoke(self, dispid, *args, **kw)
| Invoke a method or property.
|
| ----------------------------------------------------------------------
| Methods inherited from IUnknown:
|
| AddRef(self)
| Increase the internal refcount by one and return it.
|
| QueryInterface(self, interface, iid=None)
| QueryInterface(interface) -> instance
|
| Release(self)
| Decrease the internal refcount by one and return it.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from IUnknown:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from IUnknown:
|
| __metaclass__ = <class 'comtypes._cominterface_meta'>
| Metaclass for COM interfaces. Automatically creates high level
| methods from COMMETHOD lists.
|
| ----------------------------------------------------------------------
| Methods inherited from _compointer_base:
|
| __cmp__(self, other)
| Compare pointers to COM interfaces.
|
| __del__(self, _debug=<bound method Logger.debug of <logging.Logger instance at 0x00B05558>>)
| Release the COM refcount we own.
|
| __hash__(self)
| Return the hash value of the pointer.
|
| __repr__(self)
|
| ----------------------------------------------------------------------
| Class methods inherited from _compointer_base:
|
| from_param(klass, value) from comtypes._compointer_meta
| Convert 'value' into a COM pointer to the interface.
|
| This method accepts a COM pointer, or a CoClass instance
| which is QueryInterface()d.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from _compointer_base:
|
| value
| Return self.
|
| ----------------------------------------------------------------------
| Methods inherited from _ctypes._SimpleCData:
|
| __init__(...)
| x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
| __nonzero__(...)
| x.__nonzero__() <==> x != 0
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from _ctypes._SimpleCData:
|
| __new__ = <built-in method __new__ of _ctypes.SimpleType object at 0x1...
| T.__new__(S, ...) -> a new object with type S, a subtype of T