title: Python 'except' syntax error
body: <p>I'm writing a program to run on my Raspberry Pi, and I can't seem to get past this pesty syntax error. Here's my code:</p>
  
  <pre><code>import RPi.GPIO as GPIO, time
  
  GPIO.setmode(GPIO.BCM)
  
  GPIO.setup(14,GPIO.OUT)
  
  GPIO.output(14,GPIO.HIGH)
  
  def RCtime (PiPin):
    measurement = 0
    # Discharge capacitor
    GPIO.setup(PiPin, GPIO.OUT)
    GPIO.output(PiPin, GPIO.LOW)
    time.sleep(0.1)
  
    GPIO.setup(PiPin, GPIO.IN)
    # Count loops until voltage across
    # capacitor reads high on GPIO
    while (GPIO.input(PiPin) == GPIO.LOW):
      measurement += 1
  
    return measurement
  
  # Main program loop
  while True:
    print RCtime(4) # Measure timing using GPIO4
  
  except KeyboardInterrupt:
    GPIO.cleanup()
  </code></pre>
  
  <p>Returns the following error:</p>
  
  <pre><code>File "measure.py", line 28
      except KeyboardInterrupt:
           ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>I can't seem to find the problem. Can anyone help?</p>