def list_serial_port_strings():
if sys.platform.startswith('<STR_LIT>'):<EOL><INDENT>ports = ['<STR_LIT>' % (i + <NUM_LIT:1>) for i in range(<NUM_LIT>)]<EOL><DEDENT>elif sys.platform.startswith('<STR_LIT>') or sys.platform.startswith('<STR_LIT>'):<EOL><INDENT>ports = glob.glob('<STR_LIT>')<EOL><DEDENT>elif sys.platform.startswith('<STR_LIT>'):<EOL><INDENT>ports = glob.glob('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>raise EnvironmentError('<STR_LIT>')<EOL><DEDENT>result = []<EOL>for port in ports:<EOL><INDENT>try:<EOL><INDENT>s = serial.Serial(port)<EOL>s.close()<EOL>result.append(port)<EOL><DEDENT>except (OSError, serial.SerialException):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return result<EOL>
Lists serial port names.

    :raises EnvironmentError:
        On unsupported or unknown platforms
    :returns:
        A list of the serial ports available on the system

    .. seealso:: `The Stack Overflow answer
      <http://stackoverflow.com/a/14224477/1320237>`__