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:
Nontawat Numor 2022-03-31 01:19:53 +07:00 committed by GitHub
parent ba1acf3f7b
commit eaff59f00f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -185,12 +185,12 @@ In the same directory, open `greeter_client.py`. Call the new method like this:
```py
def run():
channel = grpc.insecure_channel('localhost:50051')
stub = helloworld_pb2_grpc.GreeterStub(channel)
response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
print("Greeter client received: " + response.message)
response = stub.SayHelloAgain(helloworld_pb2.HelloRequest(name='you'))
print("Greeter client received: " + response.message)
with grpc.insecure_channel('localhost:50051') as channel:
stub = helloworld_pb2_grpc.GreeterStub(channel)
response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
print("Greeter client received: " + response.message)
response = stub.SayHelloAgain(helloworld_pb2.HelloRequest(name='you'))
print("Greeter client received: " + response.message)
```
#### Run!