本文整理汇总了Python中comtypes.client.CreateObject方法的典型用法代码示例。如果您正苦于以下问题:Python client.CreateObject方法的具体用法?Python client.CreateObject怎么用?Python client.CreateObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类comtypes.client
的用法示例。
在下文中一共展示了client.CreateObject方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_com_object
# 需要导入模块: from comtypes import client [as 别名]
# 或者: from comtypes.client import CreateObject [as 别名]
def create_com_object():
try:
log.debug("Trying COM Name 'MSFileReader.XRawfile'")
obj = CreateObject('MSFileReader.XRawfile')
except Exception as e:
log.debug(e)
try:
log.debug("Trying COM Name ('XRawfile.XRawfile'")
obj = CreateObject('XRawfile.XRawfile')
except Exception as e:
log.debug(e)
raise ImportError(
('Please install the appropriate Thermo MSFileReader'
'version depending of your Python version (32 bit or 64 bit)\n%r') % e)
return obj
示例2: create_com_object
# 需要导入模块: from comtypes import client [as 别名]
# 或者: from comtypes.client import CreateObject [as 别名]
def create_com_object():
if not DLL_IS_LOADED:
raise WindowsError("Could not locate Agilent DLLs")
reader = CreateObject('Agilent.MassSpectrometry.DataAnalysis.MassSpecDataReader')
return reader
示例3: create_com_object_filter
# 需要导入模块: from comtypes import client [as 别名]
# 或者: from comtypes.client import CreateObject [as 别名]
def create_com_object_filter():
if not DLL_IS_LOADED:
raise WindowsError("Could not locate Agilent DLLs")
no_filter = CreateObject('Agilent.MassSpectrometry.DataAnalysis.MsdrPeakFilter')
return no_filter
示例4: load_vds_service
# 需要导入模块: from comtypes import client [as 别名]
# 或者: from comtypes.client import CreateObject [as 别名]
def load_vds_service():
loader = client.CreateObject(CLSID_VdsLoader, interface=IVdsServiceLoader)
svc = loader.LoadService(None)
svc.WaitForServiceReady()
return svc
示例5: instance_app
# 需要导入模块: from comtypes import client [as 别名]
# 或者: from comtypes.client import CreateObject [as 别名]
def instance_app(self, ps_id):
naming_space = [self._root]
if not self.object_name:
naming_space.append(self._object_name)
else:
naming_space.append(self.object_name)
naming_space.append(ps_id)
self._program_name = self._assemble_program_name(naming_space)
return CreateObject(self._program_name, dynamic=True)
示例6: create_com_object
# 需要导入模块: from comtypes import client [as 别名]
# 或者: from comtypes.client import CreateObject [as 别名]
def create_com_object():
try:
log.debug("obj = CreateObject('MSFileReader.XRawfile')")
obj = CreateObject('MSFileReader.XRawfile')
except Exception as exc:
log.debug(exc)
try:
log.debug("obj = CreateObject('XRawfile.XRawfile')")
obj = CreateObject('XRawfile.XRawfile')
except Exception as e:
log.debug(e)
raise ImportError(
('Please install the appropriate Thermo MSFileReader'
'version depending of your Python version (32bits or 64bits)\n%r') % e)
return obj
示例7: start
# 需要导入模块: from comtypes import client [as 别名]
# 或者: from comtypes.client import CreateObject [as 别名]
def start(self):
Rhino_tlb = GetModule("C:/Program Files/Rhinoceros 5/System/Rhino5.tlb")
RhinoScript_tlb = GetModule("C:/Program Files/Rhinoceros 5/Plug-ins/RhinoScript.tlb")
self.Rhino = CreateObject('Rhino5x64.Application').QueryInterface(Rhino_tlb.IRhino5x64Application)
while not self.Rhino.IsInitialized():
print('Initialising Rhino...')
time.sleep(0.5)
print('Rhino initialised!')
self.rs = self.Rhino.GetScriptObject().QueryInterface(RhinoScript_tlb.IRhinoScript)