.proto文件如果这个样子
message HelloRequired {
map<string, string> args = 1;
}
3 回答
![?](http://img1.sycdn.imooc.com/54584ee0000179f302200220-100-100.jpg)
Smart猫小萌
TA贡献1911条经验 获得超7个赞
test_dict = {}
test_dict["key1"] = "value1"
test_dict["key2"] = "value2"
好像直接放一个这个进去就行?
![?](http://img1.sycdn.imooc.com/54585050000156a302200220-100-100.jpg)
米琪卡哇伊
TA贡献1998条经验 获得超6个赞
如下这样赋值
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"
}
"""
添加回答
举报
0/150
提交
取消