PythonInvoke

The function wizard for the PythonInvoke function looks as follows:

Syntax

PythonInvoke(ModuleName,FunctionName,Param,…)

Parameters

ModuleName. Module name that contains function.

FunctionName. Function name.

Param1, Param2, …, ParamN. Function parameter.

NOTE. To define the parameter, specify either the number or the address of the cell where it is located.

Description

It returns function execution result in the Python language.

NOTE. Before using the functions written in the Python language, make sure that integration of Python and Foresight Analytics Platform is made.

Comments

Function can contain several parameters. New formulas are added automatically in the formula wizard after the user outs the cursor into the field with parameter. If extra parameters are added, they should be left empty. If the function contains no parameters, leave the Param field empty.

Keep in mind the following when calling a Python function:

TIP. For details on writing functions in the Python language and on import of modules into the Python library, see Python documentation.

Example

Formula Result Description
=PythonInvoke("math", "fabs", 4) 4 The module of the number 4.
=PythonInvoke("math", "fabs", C3) 4 The module of the number from the C3 cell. The C3 cell contains the number 4.
=PythonInvoke(C4, "fabs", C3) 9 The module of the number from the C3 cell. The C4 cell contains the math text value, while the C3 cell contains -9.

NOTE. math is the Python language system module containing mathematical functions, fabs is the Python language system function contained in the math module and that returns absolute value of the number.

See also:

Function Wizard │ Functions for Working with Python