def batch_files(pool_size, limit):
""" Create batches of files to process by a multiprocessing Pool """
batch_size = limit // pool_size
filenames = []
for i in range(pool_size):
batch = []
for j in range(i*batch_size, (i+1)*batch_size):
filename = 'numbers/numbers_%d.txt' % j
batch.append(filename)
filenames.append(batch)
return filenames
sort_counter_mp.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录