title: tkinter Window is freezing on simple script (no threading or else)
body: <p>I have written a simple script to get started with GUI programming in python using tkinter. When I execute the following script, the window freezes immediately. After a while Windows tells me, that Python "is not responding".</p>
  
  <p>Since I'm new to Python/tkinter and the provided script is pretty basic, I have no idea how to solve the problem.</p>
  
  <p>The following script is saved in the folder "test" and is called "test.py"</p>
  
  <pre class="lang-py prettyprint-override"><code>import tkinter
  
  def leave():
      window.destroy()
  
  window = tkinter.Tk()
  
  b = tkinter.Button(window, text="Exit", command = leave)
  b.pack()
  
  window.mainloop()
  </code></pre>
  
  <p>and to execute I run:</p>
  
  <blockquote>
    <blockquote>
      <p>[...]\test> python .\test.py</p>
    </blockquote>
  </blockquote>
  
  <p>There is no error or anything else showing up in the console (PowerShell). The only thing I get is the Windows message "python is not responding". Also when I hover over the window, the mouse icon is changing to the loading icon.</p>
  
  <p>//edit</p>
  
  <p>OS: Windows 10 Pro</p>
  
  <p>Python: 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]</p>