title: Remove excess space in tkinter grid
body: <pre><code>import Tkinter as Tk
  
  master = Tk.Tk()
  
  water = Tk.PhotoImage(file="water.gif")
  desert = Tk.PhotoImage(file="desert.gif")
  tundra = Tk.PhotoImage(file="tundra.gif")
  forest = Tk.PhotoImage(file="forest.gif")
  plains = Tk.PhotoImage(file="plains.gif")
  swamp = Tk.PhotoImage(file="swamp.gif")
  mountains = Tk.PhotoImage(file="mountains.gif")
  island = Tk.PhotoImage(file="island.gif")
  
  labels = []
  
  for i in gameMap.tiles:
      x = i.Pos[0]
      y = i.Pos[1]
      z = i.climate
      if z == "Water":
          texture = water
      elif z == "Desert":
          texture = desert
      elif z == "Tundra":
          texture = tundra
      elif z == "Forest":
          texture = forest
      elif z == "Plains":
          texture = plains
      elif z == "Mountains":
          texture = mountains
      elif z == "Swamp":
          texture = swamp
      elif z == "Island":
          texture = island
      label = Tk.Label(master, image=texture)
      labels.append([label, x, y])
  
  for i in labels:
      i[0].grid(row=i[1], column=i[2])
  
  master.mainloop()
  </code></pre>
  
  <p>This is a snippet of code covering the loop that generates the display window. The intent is to produce a grid of square images representing a randomly generated map. Earlier in the code, tiles are randomly generated as instances of the class Tile() and appended to a list in gameMap.tiles.</p>
  
  <p>gameMap.tiles.Pos is a 2-element list containing an int x and y coordinate respectively. </p>
  
  <p>gameMap.tiles.climate is a str set earlier to one of eight options.</p>
  
  <p>The code functions as intended. The only problem is that the square gifs are surrounded by a few pixels of whitespace, ruining the illusion of interconnectedness. How can I change the grid layout to remove this whitespace?</p>
  
  <p>P.S. I am aware that this segment of code is clunky (e.g. z is totally unnecessary), but I have been roundabout for debugging purposes. It will be fixed when I am able to remove this whitespace.</p>