Getting Local MAC Address

Irmen de Jong irmen-NOSPAM- at xs4all.nl
Fri Apr 2 16:59:41 EDT 2010


On 2-4-2010 22:55, danmcleran at yahoo.com wrote:
> On Apr 2, 2:52 pm, "danmcle... at yahoo.com"<danmcle... at yahoo.com>
> wrote:
>> On Apr 2, 2:14 pm, Booter<colo.av... at gmail.com>  wrote:
>>
>>> Hello all,
>>
>>> I am new to python ans was wondering if there was a way to get the mac
>>> address from the local NIC?
>>
>>> Thanks for your help.
>>
>>> Gerad
>>
>> for windows parse p.stdout.read():
>>
>> import subprocess
>>
>> p = subprocess.Popen('ipconfig', shell = True, stdout =
>> subprocess.PIPE)
>>
>> p.wait()
>>
>> print p.stdout.read()
>
> sorry, posted too soon. looks like this is for ip address only.

Actually you can get more info including the MAC address when you pass 
the /all switch.

-irmen




More information about the Python-list mailing list