File: ex5.py

package info (click to toggle)
python-gvgen 0.9-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 200 kB
  • ctags: 201
  • sloc: python: 719; sh: 24; makefile: 2
file content (25 lines) | stat: -rwxr-xr-x 740 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/python
import gvgen

if __name__ == "__main__":
    graph = gvgen.GvGen()
    parents = graph.newItem("Parents")
    father = graph.newItem("Bob", parents)
    mother = graph.newItem("Alice", parents)
    children = graph.newItem("Children")
    child1 = graph.newItem("Carol", children)
    child2 = graph.newItem("Eve", children)
    child3 = graph.newItem("Isaac", children)
    postman = graph.newItem("Postman")
    graph.newLink(father,child1)
    graph.newLink(father,child2)
    graph.newLink(mother,child2)
    graph.newLink(mother,child1)
    graph.newLink(mother,child3)
    graph.newLink(postman,child3)

    graph.styleDefaultAppend("color","Green")
    graph.styleDefaultAppend("shape","octagon")

    graph.dot()