扫码关注官方订阅号
.proto文件如果这个样子
message HelloRequired { map<string, string> args = 1; }
学习是最好的投资!
test_dict = {} test_dict["key1"] = "value1" test_dict["key2"] = "value2"
好像直接放一个这个进去就行?
如下这样赋值
import hellorequired_pb2 test = hellorequired_pb2.HelloRequired() test.args["key1"] = "value1" test.args["key2"] = "value2" print test """ 输出如下 args { key: "key1" value: "value1" } args { key: "key2" value: "value2" } """
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
好像直接放一个这个进去就行?
如下这样赋值