當前位置: 首頁>>代碼示例>>Python>>正文


Python client.CreateObject方法代碼示例

本文整理匯總了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 
開發者ID:mobiusklein,項目名稱:ms_deisotope,代碼行數:17,代碼來源:MSFileReader.py

示例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 
開發者ID:mobiusklein,項目名稱:ms_deisotope,代碼行數:7,代碼來源:AgilentD.py

示例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 
開發者ID:mobiusklein,項目名稱:ms_deisotope,代碼行數:7,代碼來源:AgilentD.py

示例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 
開發者ID:cloudbase,項目名稱:cloudbase-init,代碼行數:7,代碼來源:vds.py

示例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) 
開發者ID:loonghao,項目名稱:photoshop-python-api,代碼行數:11,代碼來源:_core.py

示例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 
開發者ID:frallain,項目名稱:pymsfilereader,代碼行數:17,代碼來源:MSFileReader.py

示例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) 
開發者ID:compas-dev,項目名稱:compas,代碼行數:11,代碼來源:client.py


注:本文中的comtypes.client.CreateObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。