BGE pressing space bar while in play mode isn't running script
This code is from pre 2.49. I'm pretty sure it runs into an error. 

Always have the console window open when running the BGE with python code. Otherwise you will not see errors caused by Python code.

Convert the above sample to (BGE 2.5 and Python 3):

import bge 

controller = bge.logic.getCurrentController()
owner = controller.owner

rotation_matrix = [ [0,-1, 0],
                    [1, 0, 0],
                    [0, 0, 1]]

sensor = controller.sensors["space"]

if sensor.positive:
    owner.worldOrientation = rotation_matrix