title: Python Thread Pause and Wait
body: <p>I have an array of threads. Each of them call the run method continuously. At the end of each run method I want them to pause and wait.</p>
  
  <p>How can I get the threads to execute one at a time, and then continue the loop when all are finished? I need them to ALWAYS execute in order (ie: 1, 2, 3, 4 - 1, 2, 3, 4...)</p>
  
  <p>I'm currently using threading.Event, but the results are inconsistent. </p>
  
  <p>Thanks</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Thanks everybody for your answers so far.</p>
  
  <p>I'm writing something similar to Robocode in python. Players program a bot and the bots battle it out until one remains. After each "turn" the bots are "paused" then updated and drawn to the screen. Then they all start a new turn.</p>
  
  <p>Example:</p>
  
  <pre><code># Bot extends threading.Thread
  class DemoBot(Bot):
      def __init__(self):
          super(DemoBot, self).__init__()
  
      def run(self):
          while True:
              self.moveForward(100)
              self.turnLeft(90)
  </code></pre>
  
  <p>As you can see, the bot is in an infinite loop. In the moveForward method, the bot would move forward 100px. But in order to update the screen correctly, I have to move once, pause, update, then move again. This is why I need to be able to "pause" a bot once its finished and have the program wait for the others before updating the screen.</p>
  
  <p>Hope that makes a little more sense.</p>