您可以简单地使用
multiprocessing.Pool:
from multiprocessing import Pooldef process_image(name): sci=fits.open('{}.fits'.format(name)) <process>if __name__ == '__main__': pool = Pool() # Create a multiprocessing Pool pool.map(process_image, data_inputs) # process data_inputs iterable with pool
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)