How to extract the mac address of a computer in Python

PHOTO EMBED

Fri Sep 17 2021 01:21:48 GMT+0000 (Coordinated Universal Time)

Saved by @JosephMuigai #python #macaddress

# How to extract the mac address of a computer
import uuid

print("The MAC address in formatted way is : ", end="")

print(':'.join(['{:02x}'.format((uuid.getnode() >> elements) & 0xff)
for elements in range(0, 8*6, 8)][::-1]))

content_copyCOPY