def getIpWindows(adapteridx):
    try:
        import wmi
    except:
        logging.error('You must need Win32com (win32 extensions for python)')
        raise
    adapters = wmi.WMI().Win32_NetworkAdapter()
    wlan_int_id = adapters[adapteridx].Index
    adaptername = adapters[adapteridx].NetConnectionID
    ip = ''
    for nic in wmi.WMI().Win32_NetworkAdapterConfiguration(IPEnabled=1):
        if (nic.Index == wlan_int_id):
            ip = nic.IPAddress[0]
    logging.info('[Windows] Showing IP for adapter %d (%s): %s', adapteridx, adaptername, ip)
    return ip
def getIpWindows(adapteridx):
    try:
        import wmi
    except:
        logging.error('You must need Win32com (win32 extensions for python)')
        raise
    adapters = wmi.WMI().Win32_NetworkAdapter()
    wlan_int_id = adapters[adapteridx].Index
    adaptername = adapters[adapteridx].NetConnectionID
    ip = 
    for nic in wmi.WMI().Win32_NetworkAdapterConfiguration(IPEnabled=1):
        if (nic.Index == wlan_int_id):
            ip = nic.IPAddress[0]
    logging.info('[Windows] Showing IP for adapter %d (%s): %s', adapteridx, adaptername, ip)
    return ip