How to realize dynamic rotation of plane

This is my code:

···mod = Sketchup.active_model # Open model
ent = mod.entities # All entities in model
sel = mod.selection # Current selection
def_list = mod.definitions
path = Sketchup.find_support_file “cube.skp”,“Components”
comp_def = def_list.load path
inst1 = ent.add_instance comp_def,[0,0,0]
tr = [0,0,0],[1,0,0],45.degrees
time =
h = time.hour
s = time.sec
i =0
while h>=8&&h<=10
if i==6
if s%10==0
ent.transform_entities tr,inst1
sleep 1
time =
h = time.hour
s = time.sec

Please format you code snippets properly…
The ‘smart-quotes’ in it break everything immediately !
Parenthesize your passed arguments without a leading space xxx(…)

Please explain clearly what it is you are trying to achieve with your code… and how it fails for you…