Python的multiprocessing的包装器,提供对tqdm进度条和共享参数的支持
项目描述
Python的multiprocessing的包装器,提供对tqdm进度条和共享参数的支持。
提供简单、熟悉的接口,并具有额外功能。
安装
pip install enhanced_multiprocessing
示例用法
from enhanced_multiprocessing import Pool
def add_n(x, n):
return x + n
# the number of processes will be set to number of cores - 1 by default
p = Pool()
# will apply add_n to the element list of length three with n=5, showing a nice progress bar along
result = p.imap(add_n, [1, 2, 3], shared_args=(5, ))
assert list(result) == [6, 7, 8]
历史
最初发布在kn-bibs/pathways-analysis,后来为krassowski/drug-disease-profile-matching进一步开发。
项目详情
下载文件
下载适合您平台的应用程序。如果您不确定要选择哪一个,请了解有关安装软件包的更多信息。
源代码分发
enhanced_multiprocessing-1.0.tar.gz (4.0 kB 查看哈希值)