title: How to draw images in tkinter window
body: <p>How do I draw an image in a tkinter window (I'm using python 3.3)? I'm looking for a statement which would draw an image at a given position on a tkinter window.</p>
  
  <p>yeah...</p>
  
  <p>Any answers would be appreciated. And here's the source code of the program (if it can be called that) that I want to use the code in, in case you need it.</p>
  
  <pre><code>from tkinter import *
  
  class craftClass():
      def __init__(self, x = 80, y = 80, xmotion = 0, ymotion = 0, health = 20):
          self.xPos, self.yPos = x, y
          self.dx, self.dy = xmotion, ymotion
      def moveCraft(self):
          self.xPos += self.dx
          self.yPos += self.dy
  
  class missileClass():
      def __init__(self, x = 0 , y = 0):
          self.xPos, self.yPos = x, y
  
  class alienClass():
      def __init__(self, x, y):
          self.xPos, self.yPos = x, y
  
      def moveForCraft(self, craftX, craftY):
          if self.xPos &lt; craftX:
              self.xPos += 2
          elif self.xPos &gt; craftX:
              self.xPos -= 2
          else:
              pass
  
      if self.yPos &lt; craftY:
          self.yPos += 2
      elif self.yPos &gt; craftY:
          self.yPos -= 2
      else:
          pass
  
  craft = craftClass()
  missileArray = []
  alienArray = []
  
  def keypress(event):
      if event.keysym == 'Escape':
          root.destroy()
  x = event.char
  if x == "w":
      craft.dy = 1
  elif x == "s":
      craft.dy = -1
  elif x == "a":
      craft.dx = -1
  elif x == "d":
      craft.dx = 1
  else:
      print(x)
  
  root = Tk()
  print(craft.dx)
  while True:
  try:
      root.bind_all('&lt;Key&gt;', keypress)
      craft.moveCraft()
      root.update()
  except TclError:
      print("exited. tcl error thrown. llop broken")
      break
  </code></pre>
  
  <p>I'm well aware that the spacing is sorta messed up, but that's something that happened while copying</p>