def _close ( self ) : self . _usb_handle . releaseInterface ( ) try : # If we're using PyUSB >= 1.0 we can re-attach the kernel driver here. self . _usb_handle . dev . attach_kernel_driver ( 0 ) except : pass self . _usb_int = None self . _usb_handle = None return True
reset usb device python windows
Release the USB interface again .
def _close(self):
        """
        Release the USB interface again.
        """
        self._usb_handle.releaseInterface()
        try:
            # If we're using PyUSB >= 1.0 we can re-attach the kernel driver here.
            self._usb_handle.dev.attach_kernel_driver(0)
        except:
            pass
        self._usb_int = None
        self._usb_handle = None
        return True