example$ regina-python
Regina 5.1
Software for low-dimensional topology
Copyright (c) 1999-2017, The Regina development team
&gt;&gt;&gt; ################################
... #
... #  Sample Python Script
... #
... #  Illustrates the traversal and manipulation of an entire packet tree.
... #
... #  See the file "tree.session" for the results of running this script.
... #
... ################################
... 
&gt;&gt;&gt; # Recreate the original SnapPea census of cusped hyperbolic manifolds
... # triangulated by at most 5 tetrahedra.
... census = Container()
&gt;&gt;&gt; for i in range(415):
...     mfd = SnapPeaCensusManifold(SnapPeaCensusManifold.SEC_5, i)
...     tri = mfd.construct()
...     tri.setLabel(mfd.name())
...     census.insertChildLast(tri)
... 
&gt;&gt;&gt; # The triangulations are now all children of the "census" container.
... # Remove all triangulations with more than two tetrahedra.
... tri = census.firstChild()
&gt;&gt;&gt; while tri != None:
...     next = tri.nextSibling()
...     if tri.size() &gt; 2:
...         tri.makeOrphan()
...     tri = next
... 
&gt;&gt;&gt; # Print the homology of each remaining triangulation.
... tri = census.firstChild()
&gt;&gt;&gt; while tri != None:
...     print tri.label() + ":", tri.homology()
...     tri = tri.nextSibling()
... 
Gieseking manifold: Z
SnapPea m001: Z + Z_2
SnapPea m002: Z + Z_2
SnapPea m003: Z + Z_5
Figure eight knot complement: Z
&gt;&gt;&gt;
