我在这个操作中使用了很多代码。我只想获得我的调制解调器上连接的所有设备。
我只有笔记本电脑,但不能买手机。
这是我的代码;
import socket
import thread
import os
fullList=[]
def getHost(ip):
try:
a=socket.gethostbyaddr(ip)
if(fullList.count(a)==0):
print a
fullList.append(a)
a=1
except:
a=1
cc=1
while(1):
for x in range(1,254):
try:
thread.start_new_thread(getHost, ("192.168.1."+str(x), ) )
except:
a=1
cc+=1
if(cc==1000):
print "test..... Count: "+str(len(fullList))
print fullList
cc=1现在我该怎么做?我应该看什么?
发布于 2018-07-12 21:00:33
我建议使用python-nmap并操作它的结果。
https://stackoverflow.com/questions/51306224
复制相似问题