I use the netifaces module.
import netifaces
print netifaces.interfaces()
but this shows the result below:
[\
We can also use Windows WMI:
import wmi
c = wmi.WMI()
qry = "select Name from Win32_NetworkAdapter where NetEnabled=True and NetConnectionStatus=2"
lst = [o.Name for o in c.query(qry)]
print(lst)
yields on my machine:
['Realtek PCIe GBE Family Controller', 'VMware Virtual Ethernet Adapter for VMnet1', 'VMware Virtual Ethernet Adapter for VMnet8', 'VirtualBox Host-Only Ethernet Adapter']
MSDN: Win32_NetworkAdapter class