Skip to content

Instantly share code, notes, and snippets.

@glennzw
Created March 25, 2013 16:56
Show Gist options
  • Save glennzw/5238660 to your computer and use it in GitHub Desktop.
Save glennzw/5238660 to your computer and use it in GitHub Desktop.
Get device MAC address in Python
import netifaces
iface='wlan0'
mac=netifaces.ifaddresses(iface)[netifaces.AF_LINK][0]['addr']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment