TopDl: example2.py
File example2.py, 396 bytes (added by , 12 years ago) |
---|
Line | |
---|---|
1 | #!/usr/bin/env python |
2 | |
3 | from deter import topdl |
4 | |
5 | subs = [ ] |
6 | elems = [ ] |
7 | |
8 | subs.append(topdl.Substrate(name='link0')) |
9 | |
10 | for elem_name in ('a', 'b'): |
11 | inf = topdl.Interface(name='inf000', substrate=['link0']) |
12 | elem = topdl.Computer(name=elem_name, interface=[inf]) |
13 | elems.append(elem) |
14 | |
15 | top = topdl.Topology(substrates=subs, elements=elems) |
16 | |
17 | print topdl.topology_to_xml(top, top='experiment') |