[solved] set a global loop_variable
Hello,
i would like to use an inline_script in a loop_sequence and set variables in the inline_script to be written into the log_file, i.e.
exp.set("stimuli",stimuli[number])
The variable [number] is set in the loop and can`t be used in the inline_script because it is Opensesame_Code and not global (am i right?).
Is there any way to use [number] in an inline_script?
Thanks a lot,
Ben
Comments
Hi Ben,
You cannot use the square-bracket syntax when using Python code. Instead, you should use self.get() to retrieve an in-the-GUI defined variable in an inline_script. So:
See also:
Cheers,
Lotje
Did you like my answer? Feel free to

thank you so much! now everthing works fine!
in combination with self.log i was able to write all variables in into the log:
thanks a lot again!