code: def scan():
      
      available = []
      for i in range(256):
          try:
              s = serial.Serial('COM'+str(i))
              available.append((i, s.portstr))
              s.close()
          except serial.SerialException:
              pass
      return available
docs: scan for available ports. return a list of tuples (num, name)
      Returns: