Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to get mac address in python

import uuid

mac_address_int = uuid.getnode()  # Get hardware address as 48-bit positive int
mac_address_hex = hex(mac_address_int)  # Create hexadecimal version of mac address

print("MAC address:", mac_address_hex)  # MAC address: 0x00005e0053af
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #mac #address #python
ADD COMMENT
Topic
Name
9+4 =