Jason Whitehorn has written a library for Python to control/read the GPIO pins based on events. It means you can write code like:
watch :pin => 23 do
puts "Pin changed from #{last_value} to #{value}"
end
#Or
after :pin => 23, :goes => :high do
puts "Button pressed"
end
… which is very intuitive and is an excellent way of doing it.
It’s for Ruby, not Python.