from multiprocessing import Pool
def f(x):
if x%2 == 0:
cr = x*x
print(cr)
return cr
else:
return None
if __name__ == '__main__':
p = Pool(5)
result = p.map(f, [1, 2, 3, 4, 5, 6, 7, 8])
print(result)
multiprocessing.Pool
最新推荐文章于 2022-12-11 19:05:07 发布