def ip_addr(interface):
    try:
        return netifaces.ifaddresses(interface)[netifaces.AF_INET][0]['addr']
    except KeyError:
        raise ValueError(_("You have selected an invalid interface"))
Get IP address from interface.
dataset/ETHPy150Open nils-werner/zget/zget/utils.py/ip_addr