diff options
author | Jakub Stasiak <jakub@stasiak.at> | 2014-12-10 15:03:43 +0000 |
---|---|---|
committer | Jakub Stasiak <jakub@stasiak.at> | 2014-12-11 13:42:29 +0000 |
commit | 54ed4b79bb8de9523b5a5b74a79b01c8aa2291a7 (patch) | |
tree | 3aab32626967940a3f578ea233999de1f9dc8f96 /examples | |
parent | 1c2205d5c9b364a825d51acd03add4de91cb645a (diff) |
Use six for Python 2/3 compatibility
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/browser.py | 6 | ||||
-rwxr-xr-x | examples/registration.py | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/examples/browser.py b/examples/browser.py index 1b3b717..9ac6d84 100755 --- a/examples/browser.py +++ b/examples/browser.py @@ -5,7 +5,9 @@ from __future__ import absolute_import, division, print_function, unicode_litera import socket -from zeroconf import raw_input, ServiceBrowser, Zeroconf +from six.moves import input + +from zeroconf import ServiceBrowser, Zeroconf class MyListener(object): @@ -38,6 +40,6 @@ if __name__ == '__main__': listener = MyListener() browser = ServiceBrowser(zeroconf, "_http._tcp.local.", listener) try: - raw_input("Waiting (press Enter to exit)...\n\n") + input("Waiting (press Enter to exit)...\n\n") finally: zeroconf.close() diff --git a/examples/registration.py b/examples/registration.py index 18e440f..50d53c1 100755 --- a/examples/registration.py +++ b/examples/registration.py @@ -4,7 +4,9 @@ import socket -from zeroconf import raw_input, ServiceInfo, Zeroconf +from six.moves import input + +from zeroconf import ServiceInfo, Zeroconf desc = {'path': '/~paulsm/'} @@ -17,7 +19,7 @@ zeroconf = Zeroconf() print("Registration of a service...") zeroconf.register_service(info) try: - raw_input("Waiting (press Enter to exit)...") + input("Waiting (press Enter to exit)...") finally: print("Unregistering...") zeroconf.unregister_service(info) |