from graphviz import Digraph

dot = Digraph(comment='The Test Table')

# 添加圆点A,A的标签是Dot A
dot.node('A', 'Dot A')

# 添加圆点 B, B的标签是Dot B
dot.node('B', 'Dot B')
# dot.view()

# 添加圆点 C, C的标签是Dot C
dot.node('C', 'Dot C')
# dot.view()

# 创建一堆边，即连接AB的两条边，连接AC的一条边。
dot.edges(['AB', 'AC', 'AB'])
# dot.view()

# 在创建两圆点之间创建一条边
dot.edge('B', 'C', 'test')
# dot.view()

#D:\ruanjian\anaconda202002\Library\bin\graphviz
# 获取DOT source源码的字符串形式
print(dot.source) 
# // The Test Table
# digraph {
#   A [label="Dot A"]
#   B [label="Dot B"]
#   C [label="Dot C"]
#   A -> B
#   A -> C
#   A -> B
#   B -> C [label=test]
# }


# 保存source到文件，并提供Graphviz引擎
dot.render('test-output/test-table.gv', view=True)


#dot -Tpdf allElectronicInformationGainOri.dot -o output1.pdf
4b47ffd4b380f89b56028380c0fb19853129a2f6
<mask token>

<mask token>
dot.node('A', 'Dot A')
dot.node('B', 'Dot B')
dot.node('C', 'Dot C')
dot.edges(['AB', 'AC', 'AB'])
dot.edge('B', 'C', 'test')
print(dot.source)
dot.render('test-output/test-table.gv', view=True)

<mask token>
dot = Digraph(comment='The Test Table')
dot.node('A', 'Dot A')
dot.node('B', 'Dot B')
dot.node('C', 'Dot C')
dot.edges(['AB', 'AC', 'AB'])
dot.edge('B', 'C', 'test')
print(dot.source)
dot.render('test-output/test-table.gv', view=True)

from graphviz import Digraph
dot = Digraph(comment='The Test Table')
dot.node('A', 'Dot A')
dot.node('B', 'Dot B')
dot.node('C', 'Dot C')
dot.edges(['AB', 'AC', 'AB'])
dot.edge('B', 'C', 'test')
print(dot.source)
dot.render('test-output/test-table.gv', view=True)

from graphviz import Digraph

dot = Digraph(comment='The Test Table')

# 添加圆点A,A的标签是Dot A
dot.node('A', 'Dot A')

# 添加圆点 B, B的标签是Dot B
dot.node('B', 'Dot B')
# dot.view()

# 添加圆点 C, C的标签是Dot C
dot.node('C', 'Dot C')
# dot.view()

# 创建一堆边，即连接AB的两条边，连接AC的一条边。
dot.edges(['AB', 'AC', 'AB'])
# dot.view()

# 在创建两圆点之间创建一条边
dot.edge('B', 'C', 'test')
# dot.view()

#D:\ruanjian\anaconda202002\Library\bin\graphviz
# 获取DOT source源码的字符串形式
print(dot.source) 
# // The Test Table
# digraph {
#   A [label="Dot A"]
#   B [label="Dot B"]
#   C [label="Dot C"]
#   A -> B
#   A -> C
#   A -> B
#   B -> C [label=test]
# }


# 保存source到文件，并提供Graphviz引擎
dot.render('test-output/test-table.gv', view=True)


#dot -Tpdf allElectronicInformationGainOri.dot -o output1.pdf