title: TypeError: argument 1 must be pygame.Surface, not function
body: <p>I'd just like to preface this by saying that I have indeed looked up this issue, but everyone who seems to have had a similar issue has found a solution that doesn't work for me. I'm using python 3.4.3 64 bit and pygame 1.9.2a and getting the error stated in the title. My code looks like this at the moment:</p>
  
  <pre><code>import pygame
  
  pygame.init()
  
  display_width = 800
  display_height = 600
  
  black = (0,0,0)
  white = (255,255,255)
  red = (200,0,0)
  bright_red = (255,0,0)
  green = (0,200,0)
  bright_green = (0,255,0)
  blue = (0,0,200)
  bright_blue = (0,0,255)
  
  gameDisplay = pygame.display.set_mode((display_width,display_height))
  pygame.display.set_caption('Le jeux')
  clock = pygame.time.Clock()
  
  thatonething = pygame.image.load('thatonething.png')
  
  def thatonething(x,y):
      gameDisplay.blit(thatonething,(x,y))
  
  x = (display_width * 0.45)
  y = (display_height * 0.8)
  
  crashed = False
  
  while not crashed:
  
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              crashed = True
          print(event) 
  
      gameDisplay.fill(white)
      thatonething(x,y)
      pygame.display.update() 
      clock.tick(30) 
  
  pygame.quit() 
  quit()
  </code></pre>
  
  <p>Running it gives me this:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/Windows 8/Desktop/Scripts/New folder/Main.py", line 39, in &lt;module&gt;
      thatonething(x,y)
    File "C:/Users/Windows 8/Desktop/Scripts/New folder/Main.py", line 24, in thatonething
      gameDisplay.blit(thatonething,(x,y))
  TypeError: argument 1 must be pygame.Surface, not function
  </code></pre>
  
  <p>Thanks in advance, and sorry if this sounds like a stupid question.</p>
  
  <p>Edit: This has now been solved thanks to Brian. For anyone with a similar issue who might see this later, the corrected version looks like this:</p>
  
  <pre><code>import pygame
  
  pygame.init()
  
  display_width = 800
  display_height = 600
  
  black = (0,0,0)
  white = (255,255,255)
  red = (200,0,0)
  bright_red = (255,0,0)
  green = (0,200,0)
  bright_green = (0,255,0)
  blue = (0,0,200)
  bright_blue = (0,0,255)
  
  gameDisplay = pygame.display.set_mode((display_width,display_height))
  pygame.display.set_caption('Le jeux')
  clock = pygame.time.Clock()
  
  thatonething = pygame.image.load('thatonething.png')
  
  def somefunction(x,y):
      gameDisplay.blit(thatonething,(x,y))
  
  x = (display_width * 0.45)
  y = (display_height * 0.8)
  
  crashed = False
  
  while not crashed:
  
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              crashed = True
          print(event) #This creates a log of the events that pygame has been handling.
  
      gameDisplay.fill(white)
      somefunction(x,y)
      pygame.display.update() #Updates everything "pygame.display.flip()" updates just one thing
      clock.tick(30) #This defines the refresh rate i.e. 30 in brackets gives 30 fps
  
  pygame.quit() #Closes the game (with the next line)
  quit()
  </code></pre>
  
  <p>The key difference is that 'thatonething' is no longer the name of the function.</p>