Python script to test IO with WiringPi GPIO on Raspberry Pi

The last week or so I have been playing about with the Raspberry Pi and Picoborg. After running the Picoborg install script I created the following script to test that it was working.

import RPi.GPIO as GPIO # import GPIO library
import time # import time library
GPIO.setup(4, GPIO.OUT) # 4 is the pin reference for first IO
GPIO.output(4, GPIO.LOW) # LOW turns IO off so this makes sure it's off to start
GPIO.output(4, GPIO.HIGH) # turn IO on
time.sleep(1) # wait 1 second
GPIO.output(4, GPIO.LOW) # turn IO off
GPIO.cleanup() # tidy up

This can be run by:
sudo chmod +x
sudo python