Created
February 16, 2015 22:10
-
-
Save dellis23/ad62d5c8186a7cd9f7da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
from flask import Flask | |
app = Flask(__name__) | |
def find_prime(start): | |
""" | |
Find a prime greater than `start`. | |
""" | |
current = start | |
while True: | |
for p in xrange(2, current): | |
if current % p == 0: | |
break | |
else: | |
return current | |
current += 1 | |
@app.route("/") | |
def home(): | |
return str(find_prime(random.randint(2 ** 25, 2 ** 26))) | |
if __name__ == "__main__": | |
app.run(host='0.0.0.0', debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment