title: how to resize an image to fit the label size? (python)
body: <p>My aim is to create a random country generator, and the flag of the country that is picked will appear. However, if the image file is bigger than the predetermined size of the label, then only part of the image is displayed. Is there a way of resizing the image to fit the label? (All other questions like this which I have seen have been answered, mentioning the PIL or Image modules. I tested them both, and they both came up with this error:</p>
  
  <p><strong>Traceback (most recent call last):
    File "C:\python\country.py", line 6, in 
      import PIL
  ImportError: No module named 'PIL'</strong></p>
  
  <p>This is my code, if it helps:</p>
  
  <pre><code>import tkinter
  from tkinter import *
  import random
  
  flags = ['England','Wales','Scotland','Northern Ireland','Republic of Ireland']
  
  def newcountry():
  
      country = random.choice(flags)
      flagLabel.config(text=country)
      if country == "England":
          flagpicture.config(image=England)
      elif country == "Wales":
          flagpicture.config(image=Wales)
      elif country == "Scotland":
          flagpicture.config(image=Scotland)
      elif country == "Northern Ireland":
          flagpicture.config(image=NorthernIreland)
      else:
          flagpicture.config(image=Ireland)
  
  root = tkinter.Tk()
  root.title("Country Generator")
  
  England = tkinter.PhotoImage(file="england.gif")
  Wales = tkinter.PhotoImage(file="wales.gif")
  Scotland = tkinter.PhotoImage(file="scotland.gif")
  NorthernIreland = tkinter.PhotoImage(file="northern ireland.gif")
  Ireland = tkinter.PhotoImage(file="republic of ireland.gif")
  blackscreen = tkinter.PhotoImage(file="black screen.gif")
  
  flagLabel = tkinter.Label(root, text="",font=('Helvetica',40))
  flagLabel.pack()
  
  flagpicture = tkinter.Label(root,image=blackscreen,height=150,width=150)
  flagpicture.pack()
  
  newflagButton = tkinter.Button(text="Next Country",command=newcountry)
  newflagButton.pack()
  </code></pre>
  
  <p>The code works perfectly fine apart from only showing part of the image. Is there a way to resize the images within the code itself?(I am using Python 3.5.1)</p>