[solved] Setting cycle variables from inline Python Script
Hello,
how can achieve from within a python inline script the same thing as "setcycle 0 var1 val1" ?
( I have all my cases in a .csv file that I would like to load. So, I need to run the command above from within an inline script)
thanks
guido
Comments
Dear Guido,
I think the simplest way to achieve your goal is, in fact, via the interface rather than an inline script. This is because you can easily paste the content of your .csv file into a loop item in the following way:
If you prefer to set your values via an inline script after all, please let me know and I will give you an example of this.
Best wishes,
Lotje
Did you like my answer? Feel free to

Update:
On a general note I would like to add that communicating about variables between the GUI and Python inline code works very easily and as follows:
self.get("var") # Note that the to-be-retrieved variable name is a string. # The returned value can be a string, float, or int # (the most appropriate is selected).self.experiment.set("var", value) # Note that the to-be-set variable name is a string, and the value can be a # string or numeric.See also the documentation on experiment functions.
Did you like my answer? Feel free to

Thanks for the replies.
I followed advice 1: prepared the experimental block in excell, built a column of setcycle num var1 val1 (using INDEX()), copied it into a .txt document, then copied into the script for the block, and adjusted the number of cycles. Once used to it, its is quite fast and flexible.
I would be grateful for a code example of how to do this inline.
I think I've found a way. Proof of concept code (inline script just before block_loop):