【问题标题】:Pydot parser : reading custom attributes in a nodePydot解析器:读取节点中的自定义属性
【发布时间】:2019-12-10 08:10:00
【问题描述】:

我有类似的点图字符串

我知道我可以使用 node.get_name() 或 node.get_label() 来读取名称/标签。

在上述情况下,我可以使用库中的哪些方法来读取“模式”或“页面”等自定义属性?

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

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

【问题讨论】:

    标签: pydot


    【解决方案1】:

    节点上的get_attributes 函数将为您提供包含所有属性的字典。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-26
      • 2017-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多