I recently bought one of these Pi Mote Control with two sockets for a Raspberry Pi
Only £19.99 so a fair price point
Now the code you get from the site is very basic but a good start to work from (personally unless you want to start from the ground up I would avoid)
A better piece of code is from the raspberry pi site ,Mini geek girls pygame
Now these are all well and good but I wanted something a bit more.
I have managed to find a wonderful bit of code and light weight webpage that you can turn the sockets on and off ,using your phone or pc/laptop.
I started with a fresh card and raspbian - I only did this to make sure I did not have to install any extras and it should work for you without any problems.
I do this from the terminal as my Pi's run headless........
Install Dependencies (might say already up to date )
sudo apt-get install python-rpi.gpio
sudo apt-get install python-pip
sudo pip install bottle
Now we need to install the webserver / program side of it.
git clone https://github.com/nat-n/socket_control.git
Now to run it :-)
you will need to run it as root because of gpio access
sudo ./app.py just to be clear sudo "dot""slash"app"dot"py
now go to your raspberry pi's ipaddress port 8080 eg 192.168.1.100:8080
pick a socket and turn it on - looking at the dos box you can see the interaction between the webpage and the program,to exit press Ctrl-c
I have to credit nat-n for the code