Anonymous
public text v1 · immutableimport os, socket
def getIPs():
f = os.popen("net view")
d = f.readlines()
f.close()
ips = []
thiscomp = socket.gethostname().upper()
for l in d:
if l.startswith(r"\\"):
name = l.split()[0][2:]
if name != thiscomp:
ips.append(socket.gethostbyname(name))
return ips