I want to print all IP addresses of local network on the Python console. Is there a way?
I've written a code for this problem but it's too slow, I need faster code.
import subprocess
ip="192.168.1."
list=[]
for i in range(1,255,1):
ipn=ip+str(i)
s = subprocess.check_output(["ping",ipn])
if ("TTL" in str(s)):
list.append(ipn)
print("ip list")
for j in list:
print(j)