From what I understand, the pb2.py file is code from the protoc file and the pb2_grpc.py file is code generated by protoc from the .proto file. But I don't understand what that means. I am very confused, can someone please explain this to me.
Thank you
I have tried to google the question, but I couldn't find anything that I could understand
Both are generated by protoc or python -m grpc_tools.protoc (a Python module that wraps protoc).
A pb2.py file contains the core Protocol Buffer (message) definitions and is created as a result of the --python_out flag being specified.
A pb2_grpc.py file contains the service and rpc (method) definitions and is created as a result of the --grpc_python_out flag being specified.
WHat is the difference between the filename_pb2_grpc.py and the filename_pb2.py files?