itom-project/itom

F9 execution of scirpt lines

photoniker opened this issue · 1 comments

The following script can of course be executed without any problems.

`mot = actuator("DummyMotor")

for _idx in range(5):
pos = 1
mot.setPosRel(0, pos)
#
`

But If the for loop is marked and executed by F9 a SyntaxError is shown in command line:

>>for _idx in range(5): pos = 1 mot.setPosRel(0, pos) # File "<string>", line 4 # SyntaxError: invalid syntax

image

The python interpreter does not accept to execute a single command, which is a comment only and it seems, that a comment in the last line is also not accepted. This is not only about F9 executions, but also when the command is run or debugged from the command line. In the latter case, an empty line will be appended before executing it.