PythonInvoke_(ModuleName: String, FunctionName: String, Params: Array)
ModuleName. Python module name in file system or system module name. When indicating Python module in file system, file with *.py extension is used. Parameter value is case-sensitive.
Find the specified unit:
In the Python installation folder next to the python3*.dll file or in the nested Scripts folder.
At the specified path which is set using the PythonPath string parameter in the registry key HKEY_CURRENT_USER\SOFTWARE\Foresight\Foresight Analytics Platform\10.0\DevEnv\Python. For details see the Connecting External Modules to Foresight Analytics Platform section.
In the folder with installed Foresight Analytics Platform.
FunctionName. The executed function name. Parameter value is case-sensitive.
Params. Parameters sent to function. Values of function parameters can be sent as a separate array or enumerated via a comma. If the executed function does not contain input parameters, do not specify Params.
The PythonInvoke_ method executes function in the Python language and returns its work result.
When creating formulas, the use of named parameters is unavailable.
The table contains examples of formulas using the PythonInvoke_ method:
Formula | Result | Description |
=PythonInvoke_("math", "fabs", 4) | 4 | Number 4 module. |
=PythonInvoke_("math", "fabs", C3) | 4 | Module of number located in the C3 cell. The C3 cell contains the 4 number. |
=PythonInvoke_(C4, "fabs", C3) | 9 | Module of number located in the C3 cell. The C4 cell contains the math text value, the C3 cell - the -9 number. |
The following parameters are used in the formulas:
math. The Python language system unit containing mathematical functions.
fabs. The Python language system function is contained in the math module. It returns absolute value of the number.
See also:
Functions Available in Expression Editor | Working with Python | Python.Invoke