title: Why does Python tkinter crash when opening this file?
body: <p>Anyone know why Python Launcher crashes when running this code? Is there something obvious I am missing as it was working before. Running on Mac from terminal.</p>
  <p>Doesn't even throw an error, so I'm not really sure what is going on.</p>
  <p>Do I need to update tkinter or is it just one of the functions that is casuing an issue?</p>
  <pre><code>import tkinter as tk
  import requests
  import json
  from PIL import ImageTk, Image
  
  root = tk.Tk()
  root.geometry(&quot;800x600&quot;)
  # root.configure(bg = 'black')
  
  # root.iconbitmap('./images/rain_jpeg.jpg')
  
  Images = dict()
  
  def display_photo(row=0, column=0):
  
      if weather_main + '_tk' not in [*Images]:
          image_1 = ImageTk.PhotoImage(Image.open(&quot;./images/&quot; + weather_main + &quot;.jpg&quot;))
          photo = tk.Label(root, image = image_1)
          photo.image = image_1
          photo.pack()
  
      text_runner()
  
  def city_clicker_runner():
      
      global weather_main
      global city
  
      city = e.get()
      request_address = &quot;https://api.openweathermap.org/data/2.5/weather?q=&quot; + city + &quot;&amp;units=metric&amp;appid=0a0699452f695d2f9f82b65af024a134&quot;
      api_request = requests.get(request_address)
      api = json.loads(api_request.content)
  
      mylabel2 = tk.Label(root, text = 'URL=' + request_address)
      # mylabel2.configure(foreground=&quot;white&quot;)
      mylabel2.pack()
  
      coordinates = api[&quot;coord&quot;]
      weather_main = api[&quot;weather&quot;][0][&quot;main&quot;]
      weather_description = api[&quot;weather&quot;][0][&quot;description&quot;]
      temp = int(api[&quot;main&quot;][&quot;temp&quot;])
  
      mainy = tk.Label(root, text = &quot;the weather is &quot; + weather_main)
      mainy.pack()
  
      display_photo()
          
  def text_runner():
  
      running = tk.Label(root, text = 'we are running')
      running.pack()
  
      mylabel = tk.Label(root, text = &quot;The weather in &quot; + city + &quot; is &quot; + weather_main + &quot; and the temperature is &quot; + str(temp), font=(&quot;Helvetica&quot;, 20))
      mylabel.pack()
  
  e = tk.Entry(root)
  e.pack()
  
  city_clicker = tk.Button(root, text = &quot;GO&quot;, command=city_clicker_runner)
  city_clicker.pack()
  
  </code></pre>