gRPC-Python3

Python 快速入門gRPC文檔

gRPC官方中文文檔

官方git倉庫:https://github.com/grpc/grpc.git

安裝gRPC環境

# GRPC Python setup requirements
coverage>=4.0
cython>=0.29.8
enum34>=1.0.4
protobuf>=3.5.0.post1
six>=1.10
wheel>=0.29
futures>=2.2.0
google-auth>=1.0.0
oauth2client==4.1.0
requests>=2.14.2
urllib3>=1.23
chardet==3.0.4
certifi==2017.4.17
idna==2.7
googleapis-common-protos==1.5.5
grpcio
grpcio-tools

編譯.proto文件命令

python -m grpc_tools.protoc -I../../protos --python_out=. --grpc_python_out=. ../../protos/helloworld.proto
# python -m grpc_tools.protoc -I存放.proto文件文件夾路徑 --python_out=生成的pb2.py文件輸出路徑 --grpc_python_out=生成的pb2_grpc.py文件路徑 .proto文件路徑

 

 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章