You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run python script from file or inline code. This component will also propagate - to dashboard flow - messages received from python script stdout, i.e. print statement.
Properties
Name
Description
Script source option
"Inline script", "Inline script as expression" or "Script file"
Script source
Source code as string literal or string expression or file path, depending on "Script source option" property
Python path
The path where to locate the "python" executable. Default is empty string which means to use "python3" or "python" on Windows (must be in PATH).
Outputs
Name
Description
handle
An integer value used as "handle" for this python script. To be used in PythonSendMessage and PythonEnd components to communicate/control python script.
message
Message emitted from the python script using stdout stream, i.e. using print statement. Note: as stdout is buffered, use sys.stdout.flush to flush data collected so far, which will result to imeddiate propagation through this output into the flow. Example: import sys print(message) sys.stdout.flush()
Note: This component will propagate through @seqout only after execution of the script is done.
PyhonSendMessage
Properties
Name
Description
handle
Value propagated from the handle output of PythonRun component.
message
The message to be sent to the python script, which will receive it through stdin. Example: for message in sys.stdin: process_message(message)
PythonEnd
Close stdin, so Python script can end as script can detect that stdin is closed. For example, the loop:
for message in sys.stdin:
...
Will break after stdin is closed.
Properties
Name
Description
handle
Value propagated from the handle output of PythonRun component.
Example
Example of using matplotlib module to draw charts inside dashboard flow:
Components
PythonRun
Run python script from file or inline code. This component will also propagate - to dashboard flow - messages received from python script
stdout
, i.e.print
statement.Properties
Outputs
PythonSendMessage
andPythonEnd
components to communicate/control python script.stdout
stream, i.e. usingprint
statement. Note: asstdout
is buffered, usesys.stdout.flush
to flush data collected so far, which will result to imeddiate propagation through this output into the flow. Example:import sys
print(message)
sys.stdout.flush()
Note: This component will propagate through
@seqout
only after execution of the script is done.PyhonSendMessage
Properties
handle
output ofPythonRun
component.stdin
. Example:for message in sys.stdin:
process_message(message)
PythonEnd
Close
stdin
, so Python script can end as script can detect thatstdin
is closed. For example, the loop:Will break after
stdin
is closed.Properties
handle
output ofPythonRun
component.Example
Example of using matplotlib module to draw charts inside dashboard flow:
Source of this dashboard project is located here: https://github.com/eez-open/studio/tree/master/docs/tutorial/python
The text was updated successfully, but these errors were encountered: