bge.logic.getCurrentController not available in 2.71?
My understanding is that you must run your python script from a controller brick. The import will not work from the TEXT view. For example, the following simple script prints hello in the system console (Window->Toggle System Console) when the h key is pressed.



Clicking on the 'Run Script' button in the TEXT view will not work.