Newer
Older
grpcdemo / python / grpcdemo_client.py
from __future__ import print_function

import grpc
import grpcdemo_pb2
import grpcdemo_pb2_grpc

import sys

PORTNO = 6000

def run():
  channel = grpc.insecure_channel('localhost:%s' % PORTNO)
  stub = grpcdemo_pb2_grpc.HostCommandStub(channel)
  response = stub.runcommand(grpcdemo_pb2.Command(command=sys.argv[1]))
  print(response.results)


if __name__ == '__main__':
  run()