title: pyserial enumerate ports
body: <p>I need list or enumerate of existing serial ports, 
  Till now I was using this method <strong>enumerate_serial_ports()</strong>, but its not working with windows 7. Do you know some alternative how can I find out available serial ports under windows 7?</p>
  
  <pre><code>def enumerate_serial_ports():
    """ Uses the Win32 registry to return an 
        iterator of serial (COM) ports 
        existing on this computer.
    """
    path = 'HARDWARE\\DEVICEMAP\\SERIALCOMM'
    try:
        key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, path)
    except WindowsError:
        raise IterationError
  
    for i in itertools.count():
        try:
            val = winreg.EnumValue(key, i)
            yield str(val[1])
        except EnvironmentError:
            break
  </code></pre>
  
  <p>I get IterationError
  <img src="https://i.stack.imgur.com/WOb5h.jpg" alt="enter image description here"></p>