mirror of https://github.com/grpc/grpc.io.git
Update quickstart in python 🍵 (#959)
I've already updated this example code to prevent confusion.
Follow with this section e122c64000/examples/python/helloworld/greeter_client.py (L29)
This commit is contained in:
parent
ba1acf3f7b
commit
eaff59f00f
|
|
@ -185,7 +185,7 @@ In the same directory, open `greeter_client.py`. Call the new method like this:
|
||||||
|
|
||||||
```py
|
```py
|
||||||
def run():
|
def run():
|
||||||
channel = grpc.insecure_channel('localhost:50051')
|
with grpc.insecure_channel('localhost:50051') as channel:
|
||||||
stub = helloworld_pb2_grpc.GreeterStub(channel)
|
stub = helloworld_pb2_grpc.GreeterStub(channel)
|
||||||
response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
|
response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
|
||||||
print("Greeter client received: " + response.message)
|
print("Greeter client received: " + response.message)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue