You can call Python functions with arguments from LianjaScript.
See
https://www.lianja.com/doc/index.php/EXECPYTHON()
Inside your Python code you can call LianjaScript using:
Lianja.evaluate( cExpr )
and
Lianja.execute( cCommand )
You can therefore reference cursors and columns in the active record e.g.
value = Lianja.evaluate(“employees.lastname”)
In 9.3 the arguments are split into sys.argv[] when the execPython() call is made. This simplifies the LianjaScript/Python integration.
Code:
#File: barrytest.py
import Lianja
import sys
def myfunc(theArg):
Lianja.writeOutput("myfunc was called with " + theArg)
return Lianja.evaluate("now()")
returnvalue = myfunc( sys.argv[1] )
Code:
// call python code from LianjaScropt returning a result
result = execPython("barrytest.py", "arg1", "arg2", "arg3")
? result
Bookmarks