Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from zeroconf import ServiceBrowser, Zeroconf
- class MyListener:
- def remove_service(self, zeroconf, type, name):
- print("Service %s removed" % (name,))
- def add_service(self, zeroconf, type, name):
- info = zeroconf.get_service_info(type, name)
- print("Service %s added, service info: %s" % (name, info))
- zeroconf = Zeroconf()
- listener = MyListener()
- browser = ServiceBrowser(zeroconf, "_airplay._tcp.local.", listener)
- try:
- input("Press enter to exit...\n\n")
- finally:
- zeroconf.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement