All templates
ScriptingIntermediate
Display Python Output
Robomotion•Updated 9 months ago

Overview
Runs an inline Python script and shows its output in a dialog. Demonstrates the Python Run node.
Display Python Output
Python is a high-level programming language known for its scripting capabilities. Robomotion enables users to run Python scripts and automate complex scenarios that require a custom approach.
What Display Python Output can do
- Run Python script (
Core.Process.StartProcess) — runspythonwith-c 'variableName = "Hello World!"\nprint(variableName)', captures stdout intomsg.python_output. - Trim output (
Core.Programming.Function) — strips trailing CR/LF frommsg.python_output. - Message Dialog (
Core.Dialog.MessageBox,optType: info) titledOutput from Python script:showsmsg.python_output, thenCore.Flow.Stop.
Behind the scenes
- The inline script uses the Python 3
print(variableName)call syntax, matching thepythoninterpreter most systems ship today. If you need Python 2 fidelity, pointinFilePathat a Python 2 binary and change the call back to theprintstatement form. - Trimming trailing newlines before the dialog keeps the message box compact —
printalways appends a\non stdout.
More scripting templates
See all 7 →- Convert Excel to PDF Using VBScriptRuns an inline VBScript that drives Excel COM to export a workbook as PDF. Shows how to bridge Robomotion with Windows scripting.
- Display JavaScript OutputExecutes an inline JavaScript snippet and surfaces its return value in a dialog. Demonstrates the JavaScript Run node.
- Display PowerShell OutputRuns a PowerShell script and displays the captured standard output in a dialog.
- Display VBScript OutputExecutes a VBScript snippet and displays its output. Useful when integrating with legacy Windows tooling.
- Extract Text from Word DocumentUses a VBScript bridge to pull raw text out of a .docx file for downstream NLP or search indexing.
- Get Login Name Using PythonRetrieves the current Windows login user via an inline Python script. Handy for audit trails or user-scoped paths.