<reponame>nrchakradhar/Notes
import grpc

# import the generated classes
import calculator_pb2
import calculator_pb2_grpc

# open a gRPC channel
# match this with what was opened in grpcCalcServer.py
channel = grpc.insecure_channel('localhost:50051')

# create a stub (client)
# stub is what grpc uses for the term client
stub = calculator_pb2_grpc.CalculatorStub(channel)

# create a valid request message
number = calculator_pb2.Number(value=144)

# make the call
response = stub.SquareRoot(number)
print(response.value)
import grpc

# import the generated classes
import calculator_pb2
import calculator_pb2_grpc

# open a gRPC channel
# match this with what was opened in grpcCalcServer.py
channel = grpc.insecure_channel('localhost:50051')

# create a stub (client)
# stub is what grpc uses for the term client
stub = calculator_pb2_grpc.CalculatorStub(channel)

# create a valid request message
number = calculator_pb2.Number(value=144)

# make the call
response = stub.SquareRoot(number)
print(response.value)
# import the generated classes # open a gRPC channel # match this with what was opened in grpcCalcServer.py # create a stub (client) # stub is what grpc uses for the term client # create a valid request message # make the call