Python Module
- 23 Jun 2021
- 1 Minute to read
- Print
- DarkLight
This documentation version is deprecated, please click here for the latest version.
Python Module
- Updated on 23 Jun 2021
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
The Python Module allows a user to execute Python scripts.
Prerequisites
The following is required before using the Python Module:
- Python needs to be downloaded and installed. To download Python, go to https://www.python.org/downloads/windows/
- Python Module needs to be properly installed. To learn how to install modules, see Installing Modules.
The following Python script will be used in the example.
import sys
def main():
print("Welcome", sys.argv[0])
if len(sys.argv) == 3:
print(" ", sys.argv[1], " ", sys.argv[2])
if __name__ == "__main__":
main()
Example
This example will demonstrate how to install the Python Module and adding a python script with two string inputs.
- Navigate to System > Settings. Click on Python Module Settings and enter the path of a python.exe file. Click SAVE.
- Navigate to System > Integrations. Right-click Python Script Projects and select Add Script Project. Name the project (Python Project 1) and click SAVE.
- Right-click on the script project and select Add Script.
- Name the script (PythonTest) and upload the Python file. Enter names for the Inputs (string1, string2) and click SAVE.
- On the Designer Project, click CREATE FLOW from the Global Action Bar and select Flow. Name the Flow (Python Flow) and click CREATE.
- To add the Python script to a Flow, navigate to Integrations > All Integrations > Python. Then, select the Python project and select the script and click ADD.
- With the step selected, change the input value mappings to Constant and enter "Hello" for string1 and "World" for string2.
- Add a Show Popup step to the Success path. Enter "Message" as the Subject. Click Unknown next to the Message field and select Select From Flow. Select Script Output [String] and click DONE.
- Connect the Error path and Done path to the End step.
- Click Save to save changes to the Flow.
Debug
- On the top action bar, click Debug. Then, click START DEBUGGING.The Popup will display the output from the script and the input strings.
Was this article helpful?