from Bio.Blast import NCBIXML
threshold = 0.0001
xmlfh = open('/home/sb/other.xml')
b_record = NCBIXML.parse(xmlfh).next()
for align in b_record.alignments:
    if align.hsps[0].expect < threshold:
        print align.accession

This code is part of the book "Python for Bioinformatics", by Sebastian Bassi (sbassi@genesdigitales.com). Return to home page.