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.

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

import armory

#put on Cylces
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['NodeTree']['NodeTree']"LNSceneNode")['NodeTree']"LNSetSceneNode")['NodeTree']"LNOnKeyboardNode")
#twinking the nodes bouttons
OnKBoard.property0 = 'Down'
OnKBoard.property1 = 'a'
ScnNode.property0 = 'Scene.001'
#link the nodes['Scene'],SetScnNode.inputs['Scene'])['Out'],SetScnNode.inputs['In'])

#link the node tree to the object.
#object actif, ici le cube
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,

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.

I am trying to automate the creation of logic nodes.