Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 615 Bytes

README.md

File metadata and controls

27 lines (19 loc) · 615 Bytes

python-parallelize

人肉闭包好!

Simple fork/join parallelism with Python's for loop

Quick Start

Installation

pip install git+https://github.com/IncubatorShokuhou/python-parallelize.git

Parallel iteration with a process/CPU:

import os
from parallelize import parallelize
    
for i in parallelize(range(100),n_jobs = "half"):   
#n_jobs can be "all","half","quarter" or any integer not more than the number of cpus( which can be caculated by multiprocessing.cpu_count())
    print(os.getpid(), i)