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)
from pivrot import results_table table = results_table(range(1, 35), transform=lambda x: 2**x) for line in table: print(line)
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)
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)