title: python : How to detect device name/id on a serial COM
body: <p>I would like some indication on how to do this in python:</p>
  
  <ul>
  <li><p>Identify the port named a specific name in the serial com (\Device\VCP0 and \Device\VCP1  these are get by browsing in regedit window) </p></li>
  <li><p>And get the id of the device that is pluged</p></li>
  </ul>
  
  <p>I can already identify the avalable COM with this pySerial code that scan up the active serial port COM</p>
  
  <pre><code>import serial
  
  def scan():
      """scan for available ports. return a list of tuples (num, name)"""
      available = []
      for i in range(256):
          try:
              s = serial.Serial(i)
              available.append( (i, s.portstr))
              s.close()   # explicit close 'cause of delayed GC in java
          except serial.SerialException:
              pass
      return available
  
  if __name__=='__main__':
      print "Found ports:"
      for n,s in scan():
          print "(%d) %s" % (n,s)
  </code></pre>
  
  <p>Thanks in advance</p>