From the course: gRPC in Python
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Generating Python code
- [Instructor] Before you can generate the Python code. You will need to install two packages, the grpcio package and the grpcio tools package. Once you have them installed, you can run the command. It is pretty long. So I wrote it in a file. So Python dash m, gRPC tools dot protoc dash I dot, meaning, look for protocol buffer's definition in the current directory. Dash dash python out dot, meaning, generate the protocol buffer's definition in the current directory. And gRPC python out again to the current directory and use the file rides dot proto. Once I'm running this file, I'm going to see two new file. One is rides pb two, which is the protocol buffers definition. And the second one is the gRPC definitions. Let's have a look at what was generated. And we see, we have a stub, which we are going to fill with our own method. And we see that the start is unary unary, meaning a request response. And then we have…