First page Back Continue Last page Overview Image

Lösung mit Threads (2)

received_packages = re.compile(r"(\d) received")

check_results = []

for suffix in range(20,70):

ip = "192.168.178."+str(suffix)

current = ip_check(ip)

check_results.append(current)

current.start()

for el in check_results:

el.join()

if el.status() == "alive":

print("Status from ", el.ip,"is",el.status())

Output:

Status from 192.168.178.22 is alive

Status from 192.168.178.27 is alive

Status from 192.168.178.35 is alive

Status from 192.168.178.41 is alive

Status from 192.168.178.50 is alive