def gputn(n):
    for i in xrange(1,n):
        if isprime(i):
            yield i

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