python - Finding host on local network using Raspberry pi -
i´m trying write python script find list of pc's connect local network using raspberry pi. reason code not work on pi while work on windows laptop.
here have far
`import socket, os dic = ("pc1", "pc2", "pc3") ips = [] in range(0, len(dic)): f = socket.gethostbyname(dic[i]) ips.append(f) print f
` following error:
traceback (most recent call last): file "<stdin>", line 2, in <module> socket.gaierror: [errno -2] name or service not known
thank in advance can give me.
Comments
Post a Comment