PythonRun
Description
Runs a python script and sends the handle of the running script to the handle
output. This handle is used in the PythonEnd
Action if we want to stop a running Python script or in the PythonSendMessage
Action if we want to send a message from Flow to a Python script, and it is needed because several scripts can be started at some point and the running script is determined through this handle.
Properties
Specific
-
Script source option
Enum
-
The source of the python script can be specified in three ways:
- Inline script
- Inline script as expression
- Script file
-
Inline script
Python
-
If
Inline script
was selected forScript source option
, then the source code of the script should be entered here. -
Inline script as expression
EXPRESSION (string)
-
If
Inline script as expression
was selected forScript source option
, then here you need to enter an expression that will return a string containing the source code of the script when evaluated. -
Script file
EXPRESSION (string)
-
If
Script file' was selected for
Script source option’, then the file path to the `.py’ file should be entered here. -
Python path
EXPRESSION (string)
-
The full path to the python command. If the python command is already in the system path, then it can be set to an empty string, i.e.
""
.
General
-
Description
String
-
This is the description of the Action component. Description is displayed below the component in the Project editor/viewer. In the main toolbar, it is possible to hide or display descriptions of all components with one click.
Flow
-
Inputs
Array
-
Additional component inputs that the user can add as desired in order to use them to receive additional data needed when evaluating expressions in properties. Each input is given a name and type. Name is used when referencing an input within an expression. A type is used to project Check to check whether a data line that transmits data of that type is connected to the input or not.
-
Outputs
Array
-
Additional component outputs that the user can add to send data through. Each output is assigned a name and type. An example of using this output is e.g. in the Loop component, where we can put the output name for the
Variable
property instead of e.g. variable name. In that case, the Loop component will not change the content of the variable in each step, but will send the current value through that output. -
Catch error
Boolean
-
If this checkbox is enabled then an
@Error
output will be added to the component and if an error occurs in this component during the execution of the Flow, the Flow will continue through that output. The data that will be passed through that output is the textual description of the error.
Position and size
-
Align and distribute
Any
-
Alignment icons and component distribution. Alignment icons appear when two or more components are selected, and distribution icons appear when three or more components are selected.
Inputs
-
seqin
SEQ | OPTIONAL
-
A standard sequence input.
Outputs
-
seqout
SEQ | OPTIONAL
-
A standard sequence output.
-
handle
DATA(integer) | OPTIONAL
-
Returns the handle of the running script used in PythonEnd and PythonSendMessage Actions.
-
message
DATA(string) | OPTIONAL
-
Everything that is printed to
stdout
within the running Python script will be sent through this output. In this way, the python script sends a message to Flow, and if Flow wants to send a message to the Python script, then the PythonSendMessage Action should be used.
Examples
- Charts