ch21 cleanup, f-strings, and pathlib

This commit is contained in:
Miroslav Šedivý committed 2021-02-13 19:11:54 +01:00
1 parent c5114a5679
commit 93dfeaeb80
11 files changed
+70 -81

No files matched your search

+4 -4
View File
@@ -6,10 +6,10 @@ but using `concurrent.futures.ProcessPoolExecutor`.
"""
# tag::PRIMES_POOL[]
import sys
from concurrent import futures # <1>
from time import perf_counter
from typing import NamedTuple
from concurrent import futures # <1>
import sys
from primes import is_prime, NUMBERS
@@ -43,8 +43,8 @@ def main() -> None:
print(f'{n:16} {label} {elapsed:9.6f}s')
time = perf_counter() - t0
print('Total time:', f'{time:0.2f}s')
print(f'Total time: {time:.2f}s')
if __name__ == '__main__':
main()
# end::PRIMES_POOL[]
# end::PRIMES_POOL[]