def working(self,ip,lista): with open(devnull, 'wb') as limbo: result=Popen(['ping', '-c', '1', '-n', '-W', '1', ip], stdout=limbo, stderr=limbo).wait() if not result: if Refactor.get_mac(ip) == None: lista[ip] = ip + '|' + 'not found' else: lista[ip] = ip + '|' + Refactor.get_mac(ip)
def working(self, ip, lista): with open(devnull, 'wb') as limbo: result = Popen(['ping', '-c', '1', '-n', '-W', '1', ip], stdout=limbo, stderr=limbo).wait() if not result: if Refactor.get_mac(ip) == None: lista[ip] = ip + '|' + 'not found' else: lista[ip] = ip + '|' + Refactor.get_mac(ip)