Project Euler Problem #50 Consecutive Prime Sums Problem: Which prime, below one-million, can be written as the sum of the most consecutive primes?

At the moment my code runs for over 200 seconds and was wondering how I can find a way to bring that down by a large amount. I have tried optimising it as much as I can and added an extra if statement, if(subSum &lt; 1000000): to reduce the need to see if subSum is a prime. Here is my code at the moment: 

def sieve(num):
    primes = []
    import math
    for i in range(num):
        primes.append(True)
    j = 1
    while(j&lt;(math.sqrt(num)+1)):
        k = (j+1)*2
        while(k&lt;(num+1)):
            primes[k-1] = False
            k+=(j+1)
        j+=1
    primes[0] = False
    prime = []
    for a in range(num):
        if(primes[a] == True):
            prime.append(a+1)
    return prime

primes = sieve(1000000)
count = 1
high = 0
length = len(primes)
while count &lt;= length: 
    i = 0
    while(i&lt;(length-count)):
        sub = primes[i:i+count]
        subSum = sum(sub)
        if(subSum &lt; 1000000):
            if(subSum in primes):
                if(subSum&gt;high):
                    high = subSum
                break
            else: 
                i+=1
        else:
            break
    count += 1
print(high)


Thanks for any help.
I'll try to focus on the performance of the code provided, and what can be done to improve it. One key observation that I found is that it is more efficient to start searching for larger consecutive sums, and move towards shorter until we find a valid candidate. 

Then the obvious question is: where do we start? To find this, simply check the cumulative sums for the first n primes. As n increases, so does the sum. When the sum is above 1000000, it would not be possible to find a sum of n primes which is in the list of primes below 1000000. With this, it can be deduced that the sum can contain 546 elements at most. You should verify this on your own.

Another observation is that 2 is the only even prime. With the knowledge that odd + odd = even, even + odd = odd + even = odd, and even + even = even, we can deduce that if and only if 2 is a part of the consecutive sum, the sum must contain an even number of elements. Thus, we must only check the very first consecutive sum (the one starting with 2) when the sum has an even number of elements. 

With all of this in place, the speed of the search is improved considerably.

n = 1000000
found = False
primes = sieve(n)
primes_set = set(primes)

for test_len in range(545, 1, -2):
    for i in range(0, len(primes)-test_len):
        s = sum(primes[i:i+test_len])
        if s in primes_set:
            print("found", test_len, s)
            found = True
            break
    if found:
        break


This is of course only a small snippet, and not the full program. For example, this does not test for even length consecutive sums, but that should be trivial with the information provided above. However, the execution time for the loop is less than a second, with the majority of the runtime now being used by the prime sieve. However, optimizing that is outside the scope of this answer.