I really recommend using this link for your GPIO access in python http://www.pcduino.com/?p=269
The example in the “Programming Tutorial” uses some weird File IO method where you are filling an array and seeing if there is a value in that array. The link above has stuff closer to what Arduino code would be