Created
March 21, 2014 01:40
-
-
Save amitsaha/9677822 to your computer and use it in GitHub Desktop.
Find MAC address of all the network interfaces
This file contains 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
import os | |
sys_net = '/sys/class/net' | |
for dev in os.listdir(sys_net): | |
with open(os.path.join(os.path.join(sys_net, dev), 'address')) as f: | |
print dev, f.read(), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment