0

我想从 dbus 守护进程返回,如下所示:

>>> rule = {'name': 'torrent', 'port': '5892'}
>>> rule2 = {'name': 'amule', 'port': '234'}
>>> rules = []
>>> rules.append(rule)
>>> rules.append(rule2)
>>> rules
[{'name': 'torrent', 'port': '5892'}, {'name': 'amule', 'port': '234'}]

我正在尝试这个:

out_signature='a{ss}'

但我收到了这个错误:

TypeError: list indices must be integers, not dict

我要使用哪个 out_signature?提前致谢!!!

4

1 回答 1

0

解决方案是这样的: out_signature='aa{ss}' 干杯!

于 2013-05-21T17:10:47.650 回答