1. 目的 今天发现我配置的一台电脑ip被人占用了,所以准备写个程序扫描一下局域网内所有正在使用的ip和主机名 2. 实现--直接上代码 import time import threading import socket threads = [] def get_hostname(ip): try: (name, aliaslist, addresslist) = socket.gethostbyaddr(ip) print name , ' ', ip except Exception as…