(self, ifname)
return ''.join(['%02x' % ord(char) for char in info[18:24]])[:-1]
Obtain local adapter's MAC; uuid mod is stupid.
Obtain local adapter's MAC; uuid mod is stupid.
Obtain local adapter s MAC ; uuid mod is stupid .
def local_mac(self, ifname):
        """Obtain local adapter's MAC; uuid mod is stupid."""
        sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        info = ioctl(sock.fileno(), 0x8927, pack('256s', ifname[:15]))
        return ''.join(['%02x' % ord(char) for char in info[18:24]])[:-1]
def local_mac ( self , ifname ) : sock = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM ) info = ioctl ( sock . fileno ( ) , 0x8927 , pack ( '256s' , ifname [ : 15 ] ) ) return '' . join ( [ '%02x' % ord ( char ) for char in info [ 18 : 24 ] ] ) [ : - 1 ]