How to get my MAC address with python ?

Rick Holbert holbertr at
Mon Feb 2 19:16:16 CET 2004

olivier Ravard wrote:

> Hi,
> I want to know the MAC address of my local network card with a python
> script.
> I tested the socket module which gives only the IP address.
> Is someone have an idea ?

Here's a url where Mark Hammond explains how to do it on Windows:

On Linux you can parse the output of the ifconfig command as described in
following url:

More information about the Python-list mailing list