python zeroconf show IPv4 addresses
问题 I'm trying to figure out how to scan the network for devices which are published by avahi. #!/usr/bin/python3 from zeroconf import ServiceBrowser, Zeroconf from time import sleep class MyListener: def remove_service(self, zeroconf, type, name): print("Service % removed" % (name)) def add_service(self, zeroconf, type, name): info = zeroconf.get_service_info(type, name) info = str(info) info = info.split(",")[6] print(info) zeroconf = Zeroconf() listener = MyListener() browser = ServiceBrowser