bge.logic.getCurrentController not available in 2.71? I'm trying to script some things in version 2.71.

To get the controller of a script, I have tried bge.logic.getCurrentController , but bge apparently is not present (unable to import). I've also tried bpy.ops.logic.getCurrentController , but logic does not have getCurrentController

Is there something obvious I'm missing? or what new command replaced this functionality?
This roadblock is wasting a lot of time that could have been very productive.

Any help is appreciated
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.