import pprint

from Bio.Sequencing import Phd

fn = '/home/sb/bt/biopython-1.50/Tests/Phd/phd1'
fh = open(fn)
rp = Phd.RecordParser()
# Create an iterator
it = Phd.Iterator(fh,rp)
for r in it:
    # All the comments are in a dictionary
    # Sequence information
    print('Sequence: %s' % r.seq)
    # Quality information for each base
    print('Quality: %s' % r.sites)

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