I am running a function for a set of multiple sets, as soon as all the process ends, the list of all the results I return. / P> def fct (variable1, variable2): # Perform an operation that does not necessarily take the same amount of time for various input variables and yields Results 1 and result 2 Return result 1, result 2 Variables 1 = [1, future = Examiner.map (FTT, Variables 1, Variables 2) '[% s]'% ',' Variables 2 = [7] with Threadpool Exclorator (Max_Workers = 8) as Exchanger , 8,9,0] .jpg (map (str, future)) Keeping the same output as a
& gt; & Gt; & Gt; [(12,3), (13,4), (14,5), (15,6)] How can I read intermediate results eg. For variable 1 = 1, variable 2 = 7 as soon as their results are calculated?
map
already, but to create the inserted string < Code> Join is fully usable. Changing it to loop will allow you to print it in auger way:
in executor.map (fct, v1, v2): print (str (i))
join
code is a bit of work, but no work is done yet:
first = Print (",", end = "") print (str (i) print ("[", end = ""] in executor.map (fct, v1, v2): if first: first = wrong other: Print (str (i), end = "") print ("]", end = "")
Comments
Post a Comment