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


Python win32.CloseHandle方法代碼示例

本文整理匯總了Python中serial.win32.CloseHandle方法的典型用法代碼示例。如果您正苦於以下問題:Python win32.CloseHandle方法的具體用法?Python win32.CloseHandle怎麽用?Python win32.CloseHandle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在serial.win32的用法示例。


在下文中一共展示了win32.CloseHandle方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _close

# 需要導入模塊: from serial import win32 [as 別名]
# 或者: from serial.win32 import CloseHandle [as 別名]
def _close(self):
        """internal close port helper"""
        if self._port_handle:
            # Restore original timeout values:
            win32.SetCommTimeouts(self._port_handle, self._orgTimeouts)
            # Close COM-Port:
            win32.CloseHandle(self._port_handle)
            if self._overlapped_read is not None:
                win32.CloseHandle(self._overlapped_read.hEvent)
                self._overlapped_read = None
            if self._overlapped_write is not None:
                win32.CloseHandle(self._overlapped_write.hEvent)
                self._overlapped_write = None
            self._port_handle = None 
開發者ID:sketchpunk,項目名稱:android3dblendermouse,代碼行數:16,代碼來源:serialwin32.py

示例2: _close

# 需要導入模塊: from serial import win32 [as 別名]
# 或者: from serial.win32 import CloseHandle [as 別名]
def _close(self):
        """internal close port helper"""
        if self.hComPort:
            # Restore original timeout values:
            win32.SetCommTimeouts(self.hComPort, self._orgTimeouts)
            # Close COM-Port:
            win32.CloseHandle(self.hComPort)
            if self._overlappedRead is not None:
                win32.CloseHandle(self._overlappedRead.hEvent)
                self._overlappedRead = None
            if self._overlappedWrite is not None:
                win32.CloseHandle(self._overlappedWrite.hEvent)
                self._overlappedWrite = None
            self.hComPort = None 
開發者ID:whaleygeek,項目名稱:microbit-gateway,代碼行數:16,代碼來源:serialwin32.py

示例3: _close

# 需要導入模塊: from serial import win32 [as 別名]
# 或者: from serial.win32 import CloseHandle [as 別名]
def _close(self):
        """internal close port helper"""
        if self._port_handle is not None:
            # Restore original timeout values:
            win32.SetCommTimeouts(self._port_handle, self._orgTimeouts)
            if self._overlapped_read is not None:
                self.cancel_read()
                win32.CloseHandle(self._overlapped_read.hEvent)
                self._overlapped_read = None
            if self._overlapped_write is not None:
                self.cancel_write()
                win32.CloseHandle(self._overlapped_write.hEvent)
                self._overlapped_write = None
            win32.CloseHandle(self._port_handle)
            self._port_handle = None 
開發者ID:arpruss,項目名稱:gcodeplot,代碼行數:17,代碼來源:serialwin32.py

示例4: close

# 需要導入模塊: from serial import win32 [as 別名]
# 或者: from serial.win32 import CloseHandle [as 別名]
def close(self):
        """Close port"""
        if self._isOpen:
            if self.hComPort:
                # Restore original timeout values:
                win32.SetCommTimeouts(self.hComPort, self._orgTimeouts)
                # Close COM-Port:
                win32.CloseHandle(self.hComPort)
                win32.CloseHandle(self._overlappedRead.hEvent)
                win32.CloseHandle(self._overlappedWrite.hEvent)
                self.hComPort = None
            self._isOpen = False 
開發者ID:respeaker,項目名稱:get_started_with_respeaker,代碼行數:14,代碼來源:serialwin32.py


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