📜  python pool - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:10.743000             🧑  作者: Mango

代码示例1
from multiprocessing import Pool

def test( v ):
    print(v)
    return v

if __name__ == '__main__':
    with Pool(2) as p:
        print(p.map(test, range(5)))