1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| import uuid import socket
def get_mac_address(): mac=uuid.UUID(int = uuid.getnode()).hex[-12:] return ":".join([mac[e:e+2] for e in range(0,11,2)])
mymac = get_mac_address()
myname = socket.getfqdn(socket.gethostname())
myaddr = socket.gethostbyname(myname)
print(mymac) print(myname) print(myaddr)
|