我需要一些关于 python 池的帮助。
def read_values(entry, second):
....
async_output = pool.map_async(partial(read_values, second='second'), string_array)
output_array = async_output.get()
上面的代码正在运行。我真的想要以下内容:
logfile = open("./async.log", "a+", 1)
def read_values(entry, second):
....
async_output = pool.map_async(partial(read_values, second=logfile), string_array)
output_array = async_output.get()
这不起作用!
是否可以将打开的文件引用传递给池?