How to get the local mac address?

bonono at bonono at
Thu Dec 15 09:50:50 CET 2005

Steve Holden wrote:
> Why should you want to associate a MAC address with a socket? Each
> interface has an IP address, and it's that you should be using.
Say for example I want to find out the MAC if a particular interface in

> It may well be possible to write Python code that will run on all
> platforms (for example, the same way as the os.path module does, by
> importing the correct piece of code according to the platform), but it
> would need maintenance. Since the interface MAC address is unimportant
> for most network applications I guess nobody has so far thought it worth
> contributing to the core.
That is a reasonable explanation.

More information about the Python-list mailing list