我正在使用Linux.我有一个名为"combine"的外部可执行文件和一个20次迭代的循环.每次迭代时,需要使用依赖于第i次迭代的参数调用"combine".例:
arguments = " "
for i in range(1,20):
arguments += str(i) + "_image.jpg "
# begin of pseudo-code
execute: "./combine" + arguments # in parallel using all cores
# pseudo-code continues
wait_for_all_previous_process_to_terminate
execute: "./merge_resized_images" # use all cores - possible for one single command?
Run Code Online (Sandbox Code Playgroud)
如何使用Python中的多处理模块实现此目的?