Pydot 解析器:读取节点中的自定义属性

Pydot parser : reading custom attributes in a node

我有像这样的点图字符串

我知道我可以使用 node.get_name() 或 node.get_label() 来阅读 name/label。

在上述情况下,我可以使用库中的哪些方法来读取 'schema' 或 'page' 等自定义属性?

发布在 pydot github 页面。没有回应

"Graph_ID_1" [label="My graph" schema="my_schema" page=2];
}```

get_attributes on nodes 函数会给你一个包含所有属性的字典。

import pydot
n = pydot.Node(my_attr="bar")
print(n.get_attributes()) # -> {'my_attr': 'bar'}