This happens because there are two events for key down and key up. To choose one of them replace the print statement with your code to invoke and delete the other unneeded lines.
Script to test the behavior:
import bge cont = bge.logic.getCurrentController() sensor = cont.sensors['Space'] # Assumes that keyboard sensor is named as 'Space' if sensor.getKeyStatus(bge.events.SPACEKEY) == bge.logic.KX_INPUT_JUST_ACTIVATED: print("sensor down") if bge.logic.keyboard.events[bge.events.SPACEKEY] ==bge.logic.KX_INPUT_JUST_ACTIVATED: print("Down") if sensor.getKeyStatus(bge.events.SPACEKEY) == bge.logic.KX_INPUT_JUST_RELEASED: print("Up")
One event picked
import bge import subprocess if bge.logic.keyboard.events[bge.events.SPACEKEY] ==bge.logic.KX_INPUT_JUST_ACTIVATED: subprocess.call(['C:\\path\\app.exe'])