Hello Martin, You can use gmpy (http://gmpy.sourceforge.net/) def primes(): n = 2 while 1: yield long(n) n = gmpy.next_prime(n) HTH, Miki http://pythonwise.blogspot.com/