This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
HelloGrpc/python-client/greet_client.py

14 lines
292 B
Python
Raw Permalink Normal View History

2020-03-09 20:15:48 +00:00
#!/usr/bin/env python3
import grpc
import hello_pb2
import hello_pb2_grpc
channel = grpc.insecure_channel("localhost:50505")
stub = hello_pb2_grpc.HelloServiceStub(channel)
reply = stub.greet(hello_pb2.GreetRequest(message="Hello service"))
print(f"service replied \"{reply.message}\"")