本文整理匯總了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)