Python for循环并行运行

from multiprocessing.dummy import Pool as ThreadPool

def fun():
	#功能处理函数
	return 0
#待处理的目标对象
items = ['apple', 'bananan', 'cake', 'dumpling']
pool = ThreadPool()
pool.map(fun, items)
pool.close()
pool.join()

你可能感兴趣的:(python,python)