paulb@63 | 1 | #!/usr/bin/env python |
paulb@63 | 2 | |
paulb@63 | 3 | import libxml2macro as n_ |
paulb@63 | 4 | import time, os |
paulb@63 | 5 | |
paulb@63 | 6 | raw_input("Start your engines with ps -p %s -fv" % os.getpid()) |
paulb@63 | 7 | t = time.time() |
paulb@63 | 8 | |
paulb@63 | 9 | l = [] |
paulb@63 | 10 | n_doc = parseFile("ot.xml") |
paulb@63 | 11 | for n_node in n_doc.xpath("//v[contains(text(), 'begat')]"): |
paulb@63 | 12 | text = n_node.nodeValue |
paulb@63 | 13 | l.append(text) |
paulb@63 | 14 | |
paulb@63 | 15 | #for n_node in n_doc.xpath("//v"): |
paulb@63 | 16 | # text = n_node.nodeValue |
paulb@63 | 17 | # if text.find(u'begat') != -1: |
paulb@63 | 18 | # print text |
paulb@63 | 19 | |
paulb@63 | 20 | print "Time taken", time.time() - t |
paulb@63 | 21 | raw_input("Stop your engines!") |
paulb@63 | 22 | |
paulb@63 | 23 | print l |
paulb@63 | 24 | |
paulb@63 | 25 | # vim: tabstop=4 expandtab shiftwidth=4 |