from Bio import SwissProt
fh = open('spfile.txt')
record = SwissProt.parse(fh).next()
for att in dir(record):
    if not att.startswith('__'):
        print(att,getattr(record,att))

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