<p>I need a cross platform method of determining the MAC address of a computer at run time.  For windows the 'wmi' module can be used and the only method under Linux I could find was to run ifconfig and run a regex across its output.  I don't like using a package that only works on one OS, and parsing the output of another program doesn't seem very elegant not to mention error prone. </p>

<p>Does anyone know a cross platform method (windows and linux) method to get the MAC address?    If not, does anyone know any more elegant methods then those I listed above?</p>

```
netifaces
```
is a good module to use for getting the mac address (and other addresses). It's crossplatform and makes a bit more sense than using socket or uuid.
```
```
import netifaces

netifaces.interfaces()
# ['lo', 'eth0', 'tun2']

netifaces.ifaddresses('eth0')[netifaces.AF_LINK]
# [{'addr': '08:00:27:50:f2:51', 'broadcast': 'ff:ff:ff:ff:ff:ff'}]
```
```
pypi location
Good Intro to netifaces