How to print results of Python ThreadPoolExecutor.map immediately?
I am running a function for several sets of iterables, returning a list of all results as soon as all processes are finished. def fct(variable1, variable2): # do an operation that does not necessarily take the same amount of # time for different input variables and yields result1 and result2 return result1, result2 variables1 = [1,2,3,4] variables2 = [7,8,9,0] with ThreadPoolExecutor(max_workers = 8) as executor: future = executor.map(fct,variables1,variables2) print '[%s]' % ', '.join(map(str, future)) >>> [ (12,3) , (13,4) , (14,5) , (15,6) ] How can I print intermediary results e.g. for