diff options
author | Leifur Halldor Asgeirsson <lasgeirsson@zerofail.com> | 2016-03-03 10:37:31 -0500 |
---|---|---|
committer | Leifur Halldor Asgeirsson <lasgeirsson@zerofail.com> | 2016-03-18 16:24:29 -0400 |
commit | 4df39871d0d9ee7f14fe9d810d217cbdd6f621e5 (patch) | |
tree | eb516d64858646be3c7ad71a1507aa2bca498149 /examples/python/helloworld | |
parent | 79787471985c8b1403b82a3f3df225496c0fd7e1 (diff) |
python3-compatible syntax for python examples
Diffstat (limited to 'examples/python/helloworld')
-rw-r--r-- | examples/python/helloworld/greeter_client.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/python/helloworld/greeter_client.py b/examples/python/helloworld/greeter_client.py index 561b25bcb2..9c18b41d25 100644 --- a/examples/python/helloworld/greeter_client.py +++ b/examples/python/helloworld/greeter_client.py @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -29,6 +29,8 @@ """The Python implementation of the GRPC helloworld.Greeter client.""" +from __future__ import print_function + from grpc.beta import implementations import helloworld_pb2 @@ -40,7 +42,7 @@ def run(): channel = implementations.insecure_channel('localhost', 50051) stub = helloworld_pb2.beta_create_Greeter_stub(channel) response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'), _TIMEOUT_SECONDS) - print "Greeter client received: " + response.message + print("Greeter client received: " + response.message) if __name__ == '__main__': |