import wmi
wmi_obj = wmi.WMI()
wmi_sql = "select IPAddress, Description from Win32_NetworkAdapterConfiguration"
wmi_out = wmi_obj.query( wmi_sql )
for dev in wmi_out:
try:
dev.IPAddress[0]
except TypeError:
print(dev.Description, "- None")
else:
print( dev.Description, "IPv4Address:", dev.IPAddress[0])
Результат работы:
WAN Miniport (SSTP) - None
WAN Miniport (IKEv2) - None
WAN Miniport (L2TP) - None
WAN Miniport (PPTP) - None
WAN Miniport (PPPOE) - None
WAN Miniport (IPv6) - None
WAN Miniport (Network Monitor) - None
Устройства Bluetooth (личной сети) - None
WAN Miniport (IP) - None
RAS Async Adapter - None
Адаптер Microsoft ISATAP - None
Realtek PCIe FE Family Controller - None
Адаптер Microsoft ISATAP - None
Intel(R) Centrino(R) Wireless-N 2230 IPv4Address: 192.168.1.34
TAP-Windows Adapter V9 - None
Microsoft Virtual WiFi Miniport Adapter - None
Адаптер Microsoft ISATAP - None
Microsoft Virtual WiFi Miniport Adapter - None