Raspberry Pi: Using Bottlypy to control GPIO

I have been trying for a few days now to get control over the GPIO pins through a webserver. There are a number of tutorials on the web but having very little web programming experience, I struggled to understand and follow the tutorials. 
After working through a number of examples, and not getting what I want, I came across the bottlepy framework. The tutorial on their website and the todo example show enough ways on how to get data to an html page and how to get data from an HTML page.
I have been super busy at work and also trying to get it to work so haven’t had a chance yet to do a bit of an explanation on what I did.
To download the files I used click here.
You will need to edit your IP address in the index.py file.
Change to the directory on your Raspberry Pi and run $ python3 index.py
In your browser navigate to IPaddress:8080/index then follow the links. Have a look in index.py to see what pins I have used for the inputs and outputs.

Sorry this is so vague but as soon as I get a chance I will update this post with some more explanations.

Greg

Raspberry Pi: GPIO input and output

So I got my Raspberry Pi yesterday and am super excited. I feel like a 10 year old on Christmas morning. I had already loaded the the Raspbian image onto an SD card so as soon as I got it I powered it up and away it ran.
The first thing that I wanted to get working was the GPIO pins. I did a bit of reading and some basic python examples and away I went. Have a look at this website for a very decent crash course in python.
The first thing you need to do is import the GPIO module. This can be installed from here
Then you need to tell python that you are going to use the Raspberry Pi’s pin numbers when referencing the ports. The direction of the port is then set.
Once the setup is complete, you can start your code. In my hardware, I connected a push button switch to pin 11 and pin 18 and an LED to pin 3 and pin 5.
import RPi.GPIO as GPIO

#use the Raspberry Pi pin numbers
GPIO.setmode(GPIO.BOARD)

#set the input with pull up control
GPIO.setup(11, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)

#set the output pins
GPIO.setup(3, GPIO.OUT)
GPIO.setup(5, GPIO.OUT)

while 1:
if GPIO.input(11):
GPIO.output(3, False)
else:
GPIO.output(3, True)

if GPIO.input(18):
GPIO.output(5, False)
else:
GPIO.output(5, True)
Above is the python code that I used. If you want to download the file you can get it here.

Once you have the file saved, run it in python and by pressing the buttons, the LED’s will turn on. To stop the program running, press CTRL+z.

Greg