Hi all , i am looking for something quite simple teh equvalent on expression :
“run myExecutedat 12 13”
in myExecutedat :
echo $arg1 $arg2
i figured out in Python it should be
op(“myExecutedat”).run(12,13 )
but i cannot figure out how to get those 2 variables
thanks
In myExecutedat you’d use:
x = args[0]
y = args[1]
print(x,y)
If myExecuteDat is a Python, a more robust way to program this would be to define your code as a function instead of having it as base level executable commands in the script
def myFunctionName(firstValue, secondValue):
print(firstValue, secondValue)
Then you can do this:
mod('myExecuteDat').myFunctionName(1, 2)
What’s nice about this is now your arguments can have useful names (rename firstValue etc to what they actually represent). It also makes your code very reusable all over your file. You can even put this DAT in local/modules to make it readable with import statements
great thanks that is better