def generate_random_mac(old_mac):
 random.seed()
 new_mac = old_mac[:8].lower().replace('-', ':')
 for i in xrange(0, 6):
  if ((i % 2) == 0):
   new_mac += ':'
  new_mac += '0123456789abcdef'[random.randint(0, 15)]
 if (new_mac == old_mac):
  new_mac = generate_random_mac(old_mac)
 return new_mac

def generate_random_mac ( old_mac ) : random . seed ( ) new_mac = old_mac [ : 8 ] . lower ( ) . replace ( '-' , ':' ) for i in xrange ( 0 , 6 ) : if ( ( i % 2 ) == 0 ) : new_mac += ':' new_mac += '0123456789abcdef' [ random . randint ( 0 , 15 ) ] if ( new_mac == old_mac ) : new_mac = generate_random_mac ( old_mac ) return new_mac
generates a random mac address .