(adapter)
return addr
Return the IP address of an adapter.
        @param adapter is the adapter to fetch from.
        I do not know how portable this is yet.
Return the IP address of an adapter.
Return the IP address of an adapter .
def get_local_ip(adapter):
    """ Return the IP address of an adapter.
        @param adapter is the adapter to fetch from.
        I do not know how portable this is yet.
    """
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    try:
        addr = socket.inet_ntoa(fcntl.ioctl(
            s.fileno(),
            0x8915,
            struct.pack('256s', adapter[:15])
        )[20:24])
    except:
        addr = None
    return addr
def get_local_ip ( adapter ) : s = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM ) try : addr = socket . inet_ntoa ( fcntl . ioctl ( s . fileno ( ) , 0x8915 , struct . pack ( '256s' , adapter [ : 15 ] ) ) [ 20 : 24 ] ) except : addr = None return addr