diff options
Diffstat (limited to 'examples/nexml/nexml_parser.py')
-rw-r--r-- | examples/nexml/nexml_parser.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/nexml/nexml_parser.py b/examples/nexml/nexml_parser.py index 67e9d66..ffd7795 100644 --- a/examples/nexml/nexml_parser.py +++ b/examples/nexml/nexml_parser.py @@ -7,10 +7,10 @@ nexml_project.build_from_file("trees.xml") # All XML elements are within the project instance. # exist in each element to access their attributes. -print "Loaded Taxa:" +print("Loaded Taxa:") for taxa in nexml_project.get_otus(): for otu in taxa.get_otu(): - print "OTU:", otu.id + print("OTU:", otu.id) # Extracts all the collection of trees in the project tree_collections = nexml_project.get_trees() @@ -21,10 +21,10 @@ collection_1 = tree_collections[0] for tree in collection_1.get_tree(): # trees contain all the nexml information in their "nexml_node", # "nexml_tree", and "nexml_edge" attributes. - print "Tree id", tree.nexml_tree.id - print tree + print("Tree id", tree.nexml_tree.id) + print(tree) for node in tree.traverse(): - print "node", node.nexml_node.id, "is associated with", node.nexml_node.otu, "OTU" + print("node", node.nexml_node.id, "is associated with", node.nexml_node.otu, "OTU") # Output: |