Here's a simple function that should give the answer pretty quickly:
primes = 
for n in xrange(2, limit+1):
# try dividing n with all primes less than sqrt(n):
for p in primes:
if n % p == 0: break # if p divides n, stop the search
if n < p*p:
primes.append(n) # if p > sqrt(n), mark n as prime and stop search
else: primes.append(n) # fallback: we actually only get here for n == 2
It relies on the fact that every composite number n must be divisible by a prime p less than or equal to its square root. (Proof: By definition, every composite number is divisible by some prime. If n is divisible by a prime p > sqrt(n), then n is also divisible by m = n / p < sqrt(n), and thus n must be divisible by some prime divisor q ≤ m < sqrt(n) of m.)
The only tricky part, performance-wise, is ensuring that we don't iterate through the list of primes any further than necessary to confirm or deny the primality of n. For this, both of the breaking conditions are important.
The code above is actually somewhat inefficient in its memory use, since it builds up the entire list of primes up to the limit before summing them. If we instead maintained a running sum in a separate variable, we wouldn't need to store any of the primes above the square root of the limit in the list. Implementing that optimization is left as an exercise.
Edit: As 200_success suggests, a well-written Sieve of Eratosthenes can indeed be faster than the trial division method described above, at the cost of using more memory. Here's an example of such a solution:
from math import sqrt
sieve = range(limit+1); sieve = 0
for n in xrange(2, int(sqrt(limit))+1):
if sieve[n] > 0:
for i in xrange(n*n, limit+1, n): sieve[i] = 0
On my computer, this runs nice and fast for a limit of 2 million or 20 million, but throws a MemoryError for 200 million.