Game Engine: how to switch scenes in python code I need to be able to switch scenes in python code while in game, and I don't mean hooking up a python controller to a scene changing actuator, I need to be able to change scenes without it. Does anyone know how it would be done?
It does exist in the API, the trick is you have to get the scene first:

for scene in bge.logic.getSceneList():
    if scene.name == 'oldSceneName':
        scene.replace('newSceneName')
        break


API:
https://www.blender.org/api/blender_python_api_2_78a_release/bge.types.KX_Scene.html#bge.types.KX_Scene.replace



Another useful 'replace scene' like thing that I have done quite a lot is to end the current scene(s) and then add the new one:

for scene in bge.logic.getSceneList():
    scene.end()
bge.logic.addScene('sceneNameGoesHere')