Here is the code for generating a prime number sequence. This code in particular, takes the users input as an integer (if it can), and prints out that many numbers of the prime number sequence. Is there any way to optimize this particular script so that it runs faster and can process bigger numbers at a greater speed?
P = 2
Count = 1
X = int(raw_input('choose number: '))
def Main(P, X):
while Count <= X:
isprime = True
for x in range(2, P - 1):
if P % x == 0:
isprime = False
if isprime:
print P
Count += 1
P += 1
Main(P, X)