点击这里
#multiprocessing template
import multiprocessing
def write_file(result):
f = open('')
f.write(result)
def process(args):
'''
work
'''
return result
if __name__ == '__main__':
pool = multiprocessing.Pool(processes = 100)
for t in tasks:
pool.apply_async(process, (t, ),callback=write_file)
pool.close()
pool.join()