Created
December 8, 2012 12:56
-
-
Save mike-zhang/4240150 to your computer and use it in GitHub Desktop.
Revisions
-
mike-zhang revised this gist
Jan 22, 2013 . 1 changed file with 15 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ # just in windows import os var = os.popen("getmac /NH /FO csv").read() #print var macList = [] for line in var.split("\n") : #print line.split(',')[0][1:-1] macAddrTmp = line.split(',')[0][1:-1] if macAddrTmp not in macList : macList.append(macAddrTmp) for macAddr in macList:print macAddr raw_input("Press Enter to continue") -
MikeZhang revised this gist
Dec 8, 2012 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,4 +2,13 @@ import os var = os.popen("wmic nicconfig get MACAddress").read() #print var macList = [] for x in var.split(" \r\n"): if len(x.strip()) > 0 and x.find("MACAddress"): if x not in macList:macList.append(x) for macAddr in macList:print macAddr raw_input("Press Enter to continue") -
MikeZhang created this gist
Dec 8, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ # just in windows import os var = os.popen("wmic nicconfig get MACAddress").read() print var