当前位置: 首页>>代码示例>>Python>>正文


Python pythoncom.CoUninitialize方法代码示例

本文整理汇总了Python中pythoncom.CoUninitialize方法的典型用法代码示例。如果您正苦于以下问题:Python pythoncom.CoUninitialize方法的具体用法?Python pythoncom.CoUninitialize怎么用?Python pythoncom.CoUninitialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pythoncom的用法示例。


在下文中一共展示了pythoncom.CoUninitialize方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: DoTestInterpInThread

# 需要导入模块: import pythoncom [as 别名]
# 或者: from pythoncom import CoUninitialize [as 别名]
def DoTestInterpInThread(cookie):
        try:
            pythoncom.CoInitialize()
            myThread = win32api.GetCurrentThreadId()
            GIT = CreateGIT()

            interp = GIT.GetInterfaceFromGlobal(cookie, pythoncom.IID_IDispatch)
            interp = win32com.client.Dispatch(interp)

            TestInterp(interp)
            interp.Exec("import win32api")
            print "The test thread id is %d, Python.Interpreter's thread ID is %d" % (myThread, interp.Eval("win32api.GetCurrentThreadId()"))
            interp = None
            pythoncom.CoUninitialize()
        except:
            traceback.print_exc() 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:18,代码来源:testGIT.py

示例2: _doTestInThread

# 需要导入模块: import pythoncom [as 别名]
# 或者: from pythoncom import CoUninitialize [as 别名]
def _doTestInThread(self, interp):
        pythoncom.CoInitialize()
        myThread = win32api.GetCurrentThreadId()

        if freeThreaded:
            interp = pythoncom.CoGetInterfaceAndReleaseStream(interp, pythoncom.IID_IDispatch)
            interp = win32com.client.Dispatch(interp)

        interp.Exec("import win32api")
        #print "The test thread id is %d, Python.Interpreter's thread ID is %d" % (myThread, interp.Eval("win32api.GetCurrentThreadId()"))
        pythoncom.CoUninitialize() 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:13,代码来源:testMarshal.py

示例3: testall

# 需要导入模块: import pythoncom [as 别名]
# 或者: from pythoncom import CoUninitialize [as 别名]
def testall():
  dotestall()
  pythoncom.CoUninitialize()
  print "AXScript Host worked correctly - %d/%d COM objects left alive." % (pythoncom._GetInterfaceCount(), pythoncom._GetGatewayCount()) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:6,代码来源:leakTest.py

示例4: serve

# 需要导入模块: import pythoncom [as 别名]
# 或者: from pythoncom import CoUninitialize [as 别名]
def serve(clsids):
	infos = factory.RegisterClassFactories(clsids)

	pythoncom.EnableQuitMessage(win32api.GetCurrentThreadId())	
	pythoncom.CoResumeClassObjects()

	pythoncom.PumpMessages()
	
	factory.RevokeClassFactories( infos )
	
	pythoncom.CoUninitialize() 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:13,代码来源:localserver.py

示例5: get_hardware_info

# 需要导入模块: import pythoncom [as 别名]
# 或者: from pythoncom import CoUninitialize [as 别名]
def get_hardware_info(response):
    pythoncom.CoInitialize()
    win32 = wmi.WMI()

    hardware = response["hardware"]

    hardware.append({Klanguage().to_ts(1011) : [get_cpu_info()]})
    #hardware.append({'Memory' : [""]})
    hardware.append({Klanguage().to_ts(1016) : get_disk_partition(win32)})
    hardware.append({Klanguage().to_ts(1017) : [get_bios_info()]})
    hardware.append({Klanguage().to_ts(1013) : get_gpu_info(win32)})
    hardware.append({Klanguage().to_ts(1012) : get_network_card_info()})

    pythoncom.CoUninitialize() 
开发者ID:turingsec,项目名称:marsnake,代码行数:16,代码来源:overview_win.py

示例6: stop

# 需要导入模块: import pythoncom [as 别名]
# 或者: from pythoncom import CoUninitialize [as 别名]
def stop(self):
        """Stop the running thread gracefully."""

        print("Stopping thread...")
        self.keep_running = False

        # Wait for the thread to stop
        self.wait()
        print("Thread stopped")

        # Uninitialize at thread stop (used for WMI in thread)
        pythoncom.CoUninitialize() 
开发者ID:akej74,项目名称:grid-control,代码行数:14,代码来源:polling.py

示例7: get_table_where

# 需要导入模块: import pythoncom [as 别名]
# 或者: from pythoncom import CoUninitialize [as 别名]
def get_table_where(self, tname, where={}):
        try:
            pythoncom.CoInitialize()
            c = WMI()
            f = getattr(c, tname)
            return f(**where)
        finally:
            pythoncom.CoUninitialize() 
开发者ID:naparuba,项目名称:opsbro,代码行数:10,代码来源:wmi.py

示例8: Quit

# 需要导入模块: import pythoncom [as 别名]
# 或者: from pythoncom import CoUninitialize [as 别名]
def Quit(self):
        self.excel.Quit()
        pythoncom.CoUninitialize() 
开发者ID:Pepitoh,项目名称:VBad,代码行数:5,代码来源:classes.py

示例9: __exit__

# 需要导入模块: import pythoncom [as 别名]
# 或者: from pythoncom import CoUninitialize [as 别名]
def __exit__(self, _type, _value, _traceback):
		pythoncom.CoUninitialize() 
开发者ID:PySimulator,项目名称:PySimulator,代码行数:4,代码来源:SimulationX.py


注:本文中的pythoncom.CoUninitialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。