(iface)
return mac
Returns MAC address of "iface".
Returns MAC address of "iface".
Returns MAC address of iface .
def get_mac_address(iface):
    """
        Returns MAC address of "iface".
    """
    proc = Popen(['ifconfig', iface], stdout=PIPE, stderr=DN)
    proc.wait()
    mac = ''
    first_line = proc.communicate()[0].split('\n')[0]
    for word in first_line.split(' '):
        if word != '': mac = word
    if mac.find('-') != -1: mac = mac.replace('-', ':')
    if len(mac) > 17: mac = mac[0:17]
    return mac
def get_mac_address ( iface ) : proc = Popen ( [ 'ifconfig' , iface ] , stdout = PIPE , stderr = DN ) proc . wait ( ) mac = '' first_line = proc . communicate ( ) [ 0 ] . split ( '\n' ) [ 0 ] for word in first_line . split ( ' ' ) : if word != '' : mac = word if mac . find ( '-' ) != - 1 : mac = mac . replace ( '-' , ':' ) if len ( mac ) > 17 : mac = mac [ 0 : 17 ] return mac