(self, ifname)
return socket.inet_ntoa(info)
Obtain local adapter's IP
Obtain local adapter's IP
Obtain local adapter s IP
def local_ip(self, ifname):
        """Obtain local adapter's IP"""
        sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        info = ioctl(sock.fileno(), 0x8915, pack('256s', ifname[:15]))[20:24]
        return socket.inet_ntoa(info)
def local_ip ( self , ifname ) : sock = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM ) info = ioctl ( sock . fileno ( ) , 0x8915 , pack ( '256s' , ifname [ : 15 ] ) ) [ 20 : 24 ] return socket . inet_ntoa ( info )