title: Segmentation fault: 11 when I run Pygame
body: <p>Somebody asked a similar question <a href="https://stackoverflow.com/questions/34278488/pygame-display-causing-segmentation-fault-11">here</a>, but it didn't get answered.</p>
  
  <p>I have Python 2.7.11, OSX 10.11, and pygame 1.9.1. Every time I run the program, the window appears, and then closes with the error "Segmentation fault: 11". I got this from the pygame tutorials, and then modified it slightly to prevent an infinite loop. (the same error occurs even if I use the "while 1" loop used in the tutorial.)</p>
  
  <p>Why is this happening and how can I fix it? Thanks!</p>
  
  <pre><code>import sys, pygame
  pygame.init()
  
  size = width,height = 320,240
  speed = [2,2]
  black = 0,0,0
  
  screen = pygame.display.set_mode(size)
  
  ball = pygame.image.load("ball.gif")
  ballrect = ball.get_rect()
  
  for i in range(100):
      ballrect = ballrect.move(speed)
      if ballrect.left &lt; 1 or ballrect.right &gt; width - 1:
          speed[0] = -speed[0]
      if ballrect.top &lt; 1 or ballrect.bottom &gt; height - 1:
          speed[1] = -speed[1]
  
      screen.fill(black)
      screen.blit(ball,ballrect)
      pygame.display.flip()
  </code></pre>