Change scene, set scene, scene, on keyboard

Hello to all I thought it should be cool to share my work on preseting a scene using python.

I am planing to :
-change scene
-move up down left right the camera
-scrole by the mouse.

But first.
Is the setting bellow works on your computer???

It does not on my laptop.

If I do it with node it’s working.

Any advice will be welcomed.

#PreparationAutomatisationNodesArmoryVersion2
#you need to create a new scene, full copy, take care about Engine.


import armory


#put on Cylces
scn=bpy.context.scene
scn.render.engine = 'CYCLES'

#Save File
bpy.ops.wm.save_as_mainfile(filepath='C:\\test\\output\\Work on Script.blend')

#change Scene Node Tree

#create the Node tree
armory.bpy.ops.node.new_node_tree(type='CompositorNodeTree', name="NodeTree")
#the nodes
LogicTree=armory.bpy.data.node_groups['NodeTree']
ScnNode=armory.bpy.data.node_groups['NodeTree'].nodes.new("LNSceneNode")
SetScnNode=armory.bpy.data.node_groups['NodeTree'].nodes.new("LNSetSceneNode")
OnKBoard=armory.bpy.data.node_groups['NodeTree'].nodes.new("LNOnKeyboardNode")
#twinking the nodes bouttons
OnKBoard.property0 = 'Down'
OnKBoard.property1 = 'a'
ScnNode.property0 = 'Scene.001'
#link the nodes
LogicTree.links.new(ScnNode.outputs['Scene'],SetScnNode.inputs['Scene'])
LogicTree.links.new(OnKBoard.outputs['Out'],SetScnNode.inputs['In'])

#link the node tree to the object.
#object actif, ici le cube
bpy.ops.arm_traitlist.new_item(is_object=True)
bpy.context.object.arm_traitlist[0].type_prop='Logic Nodes'
bpy.context.object.arm_traitlist[0].nodes_name_prop = "NodeTree"

change scene, set scene, scene and on keyboard nodes all seem to work completely fine for me.
tho change scene and set scene is really slow on slower rams, it seems reasonable for a high end gaming machine, as it works nearly 15 times faster on 2 times faster ddr4. (my previous laptop had SODDIM memory, and it took 1142 Milliseconds to load a 2 MB scene, the new one is fast enough for the recorder to not record it.)

Thanks Parsa_Shahzeidi,
thanks for the Help.

My computer is 2011, and Laptop.
I am doing things but can’t really check them.

As said upper I am preparing scenes in Python.

Here is the code,

http://pasteall.org/1351755/python

The Logics nodes does not appears in my computer,
I have no python errors then I assume that everything is fine.

It is still a mystery why the nodes does not appears.
But the Nodetree are created.

http://pasteall.org/1352125/python

I am trying to automate the creation of logic nodes.