我希望从这样的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? 在此先感谢!!!
答案 0 :(得分:0)
解决方案是:out_signature ='aa {ss}' 干杯!