title: Pause a python tkinter script indefinetly
body: <p>I have a game in <code>Tkinter</code> in which I want to implement a pause option. I want to <code>bind</code> the key <kbd>p</kbd> to stop the script. I tried using <code>time.sleep</code>, but I want to pause the game until the user presses <kbd>u</kbd>. I have tried:</p>
  
  <pre><code>def pause(self, event):
      self.paused = True
      while self.paused:
          time.sleep(0.000001)
  def unpause(self, event):
      self.paused = False
  </code></pre>
  
  <p>However, this crashes the program and doesn't un-pause. </p>
  
  <p>What is going wrong and how can I fix it?</p>