使用PySwip查询字典(Python-Prolog)

时间:2019-05-24 19:26:12

标签: python prolog swi-prolog

这可能是一个超级利基的问题。我可以像这样在Prolog中查询字典:

Customer = customer{age: 26, name: jodie}.

产生

Customer = customer{age:26, name:jodie}.

但是,在PySwip中,我得到的结果是乱码,

from pyswip import Prolog
prolog = Prolog()
list(prolog.query('Customer = customer{age: 26, name: jodie}'))

输出

[{'Customer': 'dict(customer, jodie, name, 26, age)'}]

我如何让PySwip给我列出命令列表,例如

[{'Customer': {name: 'jodie', age: 26}}]

0 个答案:

没有答案