示例#1
0
from pivrot import results_table

PRIMES_FILE = './primes.txt'

with open(PRIMES_FILE) as primes_file:
    PRIMES = (
        int(text)
        for text in primes_file.readlines()
        if text and text != '\n'
    )

table = results_table(PRIMES)

for line in table:
    print(line)

示例#2
0
from pivrot import results_table

table = results_table(range(1, 35), transform=lambda x: 2**x)

for line in table:
    print(line)

示例#3
0
from pivrot import results_table

table = results_table(range(1, 10**6))

with open('results.txt', 'w') as file:
    for line in table:
        file.write(line + '\n')
        print(line)

示例#4
0
from pivrot import results_table

PRIMES_FILE = './primes.txt'

with open(PRIMES_FILE) as primes_file:
    PRIMES = (int(text) for text in primes_file.readlines()
              if text and text != '\n')

table = results_table(PRIMES)

for line in table:
    print(line)