Created
February 2, 2017 14:51
-
-
Save guessi/a04fd9b83678e1c2f12e89d8547d39a3 to your computer and use it in GitHub Desktop.
Get MAC address in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import uuid | |
macaddr_hex = uuid.UUID(int=uuid.getnode()).hex[-12:] | |
print(':'.join(macaddr_hex[i:i + 2] for i in range(0, 11, 2))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment