title: How to wait till all threads finish their work?
body: <p>I have the following script (don't refer to the contents):</p>
  
  <pre><code>import _thread
  
  def func1(arg1, arg2):
      print("Write to CLI")
  
  def verify_result():
      func1()
  
  
  for _ in range (4):
      _thread.start_new_thread(func1, (DUT1_CLI, '0'))
  
  verify_result()
  </code></pre>
  
  <p>I want to concurrently execute (say 4 threads) <strong>func1()</strong> which in my case includes a function call that can take time to execute. Then, only after the last thread finished its work I want to execute <strong>verify_result()</strong>.</p>
  
  <p>Currently, the result I get is that all threads finish their job, but <strong>verify_result()</strong> is executed before all threads finish their job.</p>
  
  <p>I have even tried to use the following code (of course I imported threading) under the for loop but that didn't do the work (don't refer to the arguments)</p>
  
  <pre><code>t = threading.Thread(target = Enable_WatchDog, args = (URL_List[x], 180, Terminal_List[x], '0'))
  t.start()
  t.join()
  </code></pre>