title: How to make python wait until the previous task is finished?
body: <p>Hi I am experimenting with Speech Synthesis on mac, and I always put while loops in my programs so that I can use them until I decide to stop, and with this code, it repeats "What would you like me to say?" At the same time it says whatever I tell it to say.</p>
  
  <pre><code>from Cocoa import NSSpeechSynthesizer
  while 1==1
      sp = NSSpeechSynthesizer.alloc().initWithVoice_(None)
      sp.startSpeakingString_("What would you like me to say?")    
      say_1 = raw_input("What would you like me to say?")
      sp.startSpeakingString_(say_1)
  </code></pre>
  
  <p>Can someone tell me how to tell python to wait until it is done saying what I tell it to?</p>