Project Euler #3 - how inefficient is my code?
You can save quite a bit time on your prime generation. What you should keep in mind is that a prime is a number which is no multiple of a prime itself; all other numbers are.

So in your isPrime function you can just go through your primes list and check if each prime is a divisor of the number. If not, then it is a prime itself. Of course you would need to make sure that you fill your primes list enough first.

As the most basic idea, you only need to check until sqrt(n), so you only generate numbers this far. And you can also just skip every even number directly. You could also make similar assumptions for numbers dividable by 3 etc., but the even/uneven is the simplest one and enough to get fast results for not too big numbers.

So a prime generation algorithm, for possible prime divisors up to n, could look like this:

primes = [2]
for i in range(3, int(math.sqrt(n)), 2):
    isPrime = not any(i % p == 0 for p in primes)
    if isPrime:
        primes.append(i)


Then to get the prime factors of n, you just need to check those computed primes:

primeFactors = []
m = n
for p in primes:
    while m % p == 0:
        m = m / p
        primeFactors.append(p)
    if m == 0:
        break

print('The prime factorization of `{0}` is: {1}'.format(n, '×'.join(map(str,primeFactors))))


For the euler problem 3 with n = 317584931803, this would produce the following output:


  The prime factorization of 317584931803 is: 67×829×1459×3919