3 ms·
(Python) Parallelism in one line
- onuryavuz 12y agoI've just tried and it works perfectly. Any suggestions to decide on number of threads other than trial and error ?
- towelguy 12y agoFor python 3 there's also concurrent.futures: from concurrent.futures import ThreadPoolExecutor ... with ThreadPoolExecutor(max_workers=4) as executor: executor.map(create_thumbnail, images)