June 2017
Intermediate to advanced
446 pages
10h 10m
English
We can reproduce the same topology graph as before using the Python Graphviz package that we have installed:
$ python3Python 3.5.2 (default, Nov 17 2016, 17:05:23)>>> from graphviz import Digraph>>> my_graph = Digraph(comment="My Network")>>> my_graph.node("core")>>> my_graph.node("distribution")>>> my_graph.node("access1")>>> my_graph.node("access2")>>> my_graph.edge("core", "distribution")>>> my_graph.edge("distribution", "access1")>>> my_graph.edge("distribution", "access2")
The code basically produces what you would normally write in the DOT language. You can view the source:
>>> print(my_graph.source)// My Networkdigraph { core distribution access1 access2 core -> distribution distribution -> access1 distribution ...Read now
Unlock full access