src/comm2checker.py
def _seachCOMPort(self, devname: str) -> str:
        """
        Search number of COM port from device name

        Parameters
        ----------
            devname: str
                device name
        Returns
        ----------
            str
                COM port
        """
        # make list of all device name at each com ports
        ports = serial.tools.list_ports.comports()
        device = [info for info in ports if devname in info.description]
        # return
        if len(device) == 0:
            return None
        try:
            return str(serial.Serial(device[0].device).port)
        except:
            return None

        Search number of COM port from device name

        Parameters
        ----------
            devname: str
                device name
        Returns
        ----------
            str
                COM port
        
Search number of COM port from device name
Parameters

str
device name
Returns

str
COM port
Search number of COM port from device name Parameters str device name Returns str COM port
def _seachCOMPort(self, devname: str) -> str:
        ports = serial.tools.list_ports.comports()
        device = [info for info in ports if devname in info.description]
        if len(device) == 0:
            return None
        try:
            return str(serial.Serial(device[0].device).port)
        except:
            return None
def _seachCOMPort ( self , devname : str ) -> str : ports = serial . tools . list_ports . comports ( ) device = [ info for info in ports if devname in info . description ] if len ( device ) == 0 : return None try : return str ( serial . Serial ( device [ 0 ] . device ) . port ) except : return None
Search number of COM port from device name
Parameters
Search number of COM port from device name Parameters
"""
        Search number of COM port from device name

        Parameters
        ----------
            devname: str
                device name
        Returns
        ----------
            str
                COM port
        """ # make list of all device name at each com ports # return
self
devname
str