Hash :
63806d57
Author :
Date :
2022-03-21T16:18:07
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
version 17.0
local a = 2
local b = 3
python:
from sfi import Scalar
def calcsum(num1, num2):
res = num1 + num2
Scalar.setValue("result", res)
calcsum(‘a’, ‘b’)
end
display result
----------------------------------------------------
[
["command", "version"],
["number", "17.0"],
["command", "local"],
" a ",
["operator", "="],
["number", "2"],
["command", "local"],
" b ",
["operator", "="],
["number", "3"],
["command", "python"],
["punctuation", ":"],
["python", [
["keyword", "from"],
" sfi ",
["keyword", "import"],
" Scalar\r\n",
["keyword", "def"],
["function", "calcsum"],
["punctuation", "("],
"num1",
["punctuation", ","],
" num2",
["punctuation", ")"],
["punctuation", ":"],
"\r\n\tres ",
["operator", "="],
" num1 ",
["operator", "+"],
" num2\r\n\tScalar",
["punctuation", "."],
"setValue",
["punctuation", "("],
["string", "\"result\""],
["punctuation", ","],
" res",
["punctuation", ")"],
"\r\ncalcsum",
["punctuation", "("],
"‘a’",
["punctuation", ","],
" ‘b’",
["punctuation", ")"]
]],
["command", "end"],
["command", "display"],
" result"
]