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
""" | |
The daemon module implements the support classes for creating daemon processes. | |
Classes: | |
Daemon - base class for constructing a daemon process | |
""" | |
import sys, os, time, atexit | |
from signal import SIGTERM |
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
""" | |
Functions: | |
calc - calculate the specified number of primes starting with 2 | |
findTypes - find the types in the current list of primes | |
""" | |
from math import sqrt | |
primeList = [2] | |
gapList = [] |
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 sys | |
def calcPi(): | |
q, r, t, k, n, l = 1, 0, 1, 1, 3, 3 | |
while True: | |
if 4*q+r-t < n*t: | |
yield n | |
nr = 10*(r-n*t) | |
n = ((10*(3*q+r))//t)-10*n | |
q *= 10 |
NewerOlder