It's a prime number ... Counting prime numbers ...

** ■ Code confirmation **

[root@entaku19890818 ~]# cat prime.py
#coding: UTF-8
from bottle import route,template,run
@route('/prime')

def prime():
        MAX = 10000
        LIST = range(2, MAX + 1)
        for i in range(2, int(MAX ** 0.5)):
                LIST = [x for x in LIST if (x == i or x % i != 0)]
        for j in LIST:
                 print j

run(host='www.entaku19890818.com', port=8080)

** ■ Execution **

[root@entaku19890818 ~]# python prime.py
Bottle v0.13-dev server starting up (using WSGIRefServer())...
Listening on http://www.entaku19890818.com:8080/
Hit Ctrl-C to quit.

2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
73
79
83
89
97
42.146.144.127 - - [05/May/2015 12:58:58] "GET /prime HTTP/1.1" 200 0

I really want to display it on the Web.

Recommended Posts

It's a prime number ... Counting prime numbers ...
It's a stopwatch
Judge whether it is a prime number [Python]
Prime numbers and divisors
I made a prime number generation program in Python
Discrimination of prime numbers
Recursively find prime numbers
I made a prime number generation program in Python 2
Prime numbers in Python
Prime number 2 in Python
This year's prime numbers
10. Counting the number of lines
A1 notation and 26-ary number
I tried to create a list of prime numbers with python
I made a prime number table output program in various languages
A program that determines whether a number entered in Python is a prime number
A script that returns 0, 1 attached to the first Python prime number