title: Threading in python pause resume options for multiple threads with nested for loops
body: <p>I have the following code. I need to pause and resume randomly 1 of the threads I know how to random choice but how to pause them and resume later the thread. I look around over the all answers nothing work for me, I try with lock the thread is not locking I try with event again I don't manage to pause the thread. Any help is welcome. I am not a python developer, I just do a project.</p>
  <pre><code>def fistLoop():
  for x in range(0,10):
      print(str(x) + &quot; this is first loop&quot;)
      time.sleep(10)
  def secondLoop():
      for x in range(10,20):
          print(str(x) + &quot; second loop&quot;)
          time.sleep(10)
  
  
  first = threading.Thread(target=fistLoop, args=())
  second = threading.Thread(target=secondLoop, args=())
  
  threadList = list()
  first.start()
  second.start()
  </code></pre>