當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。