I need to translate my C # code to python. I have a task in C # and I need to translate it into python. Here is the code snippet:
List<Task> t = new List<Task>(); for(int i = 0; i < _tasks.Count; i++) { var theTask = _tasks[i]; t.Add(Task.Factory.StartNew(() => theTask.SAPTask.Execute(theTask.index, theTask.WindowCount))); } t.ForEach(x => x.Wait());
This small piece of code is critical to running my program. I need python to run all the tasks in the list in separate threads and block the main thread until all tasks are complete. Does this function have python?
source share