Skip to main content

Execute Python Script

Description

Execute Python Script is a step in the Scripting Plugin for Process Studio Workflows. This step is used to execute Python Script.

Recommendation: For more accurate execution results, we recommend using Python version 3.10.0 and above.

Prerequisites

Three ways to install Python:

  1. Install using python.exe:

    1. Download python.exe from https://www.python.org/downloads and install it.
    2. Install required python 3rd party libraries using pip, according to your requirements.
    3. Add/Append the following file paths to the PATH Environment Variable as follow: <path_till_python_directory>\Python310; <path_till_python_directory>\Python310\Scripts;
  2. Install using Anaconda software:

    1. Download Anaconda from https://www.anaconda.com/download and install it.
    2. Manually set Anaconda in the PATH environment variable by adding the following to the path: <ANACONDA_BASE>; <ANACONDA_BASE>\Library\mingw-w64\bin; <ANACONDA_BASE>\Library\user\bin; <ANACONDA_BASE>\Library\bin; <ANACONDA_BASE>\Scripts;
    3. Install required python 3rd party libraries using conda or pip or Anaconda GUI, according to your requirements.

Note: Please note that for above two types of installation, it is user's responsibility to install python and its dependencies and troubleshoot the problems if any related to python setup.

  1. Install using AE_Python:
    1. Get python setup zip(Python36.zip or Python38.zip or Python310.zip) file from AutomationEdge.
    2. Extract the python setup zip.

Note: AE_Python.zip is available only for Windows OS. For other OS users, please reach out to your System Administrator for help with Python installation.

Advantages of using AE_Python zip:

  1. The extracted python file from zip takes considerably less hard disk size as compared to python using Anaconda setup.
  2. If system is using let's say Python 3.x and if user wants to use Python 3.10.0 for AE purpose, then user can do so easily by keeping AE_Python inside specific location.

Users original Python 3.x and path in environment variables will not be touched.

For Default Installation:

  1. Get Python Setup zip(For example, Python310.zip) file from AutomationEdge.
  2. Extract Python310.
  3. Add the following filepaths to the PATH Environment Variable as below: <path_till_python_directory>\Python310; <path_till_python_directory>\Python310\Scripts;

For AE Specific Installation:

  1. Get Python Setup zip(For example, Python310.zip) file from AutomationEdge.
  2. Close Process Studio instances and/or Agents where Machine Learning plugin is to be used.
  3. Create a folder called as ‘python’ – case sensitive i.e., all letters in small case – in your <Process Studio root> and/or <Agent root> folders*.
  4. Unzip the downloaded zip file in following location: <Process Studio root>/python/ and / or <Agent root>/python/
  5. Post completion of above step, your folder structure should now look like <Process Studio root>/python/AE_Python<Version> E.g., D:/process-studio/python/AE_Python310 <Agent root>/python/AE_Python<Version> E.g., D:/ae-agent/python/AE_Python310
  6. Start Process Studio instances and/or Agents wherever this change has been made. In case if we have not already closed either the Process Studio instance or AE-Agent instance, simply restart these instances to achieve the same impact.

Note: <Process Studio Root> is the main Process Studio folder once you have unzipped the Process Studio zip file downloaded from AEUI (by default, the folder name is process-studio) and similarly <Agent home> is main agent folder after unzipping <named ae-agent>.

Configurations

No.Field NameDescription
1Step nameSpecify the name of the step as it appears in the workflow workspace. This name has to be unique in a single workflow.
Row Handling:
2No. of rows to processSelect No. of rows to process for row handling from input steps data frames from the following,

- All

- Row by Row or

- Batch: If batch is selected a value needs to be provided in the size field.

3Reservoir SamplingEnable checkbox to randomly sample rows from an incoming data stream. If checkbox is enabled a value needs to be provided in the size field. Random seed field is also enabled and user can provide a value.
4Random seedRandom seed is enabled only if Reservoir checkbox is enabled. Provide a value to use for seeding the random number generator. Repeating a workflow with a different value for the seed will result in a different random sample being chosen.
Options:
5Include Input Fields as Output Fields checkboxEnable this checkbox to include incoming fields as output fields.
Input Frames:
6Step nameInput step name are visible here in a dropdown list. Data from input steps is available as a Data frame.
7Pandas frame nameProvide Pandas frame name for step name above. Or else use system generated name (for e.g. ps_data0)
Field NameDescription
Python Script
Load Script from file at RuntimeEnable checkbox to load python script dynamically from a file at runtime.
Script file Location and Browse buttonBrowse for the python script file.
Manual Python ScriptIt is a free textbox where user can write Python Script.
Python Variables to getProvide output variable name or frame name from the python script.
Continue on unset variablesEnable checkbox to specify: Don’t raise an error if specified variables are not set in python after script has executed.
No.Field NameDescription
Output Fields:
1Output Fields:
1NameGet the name of python output fields.
2TypeProvide the data type of the field above.
Buttons:
1Vars to FieldsClick button to get Python frame.
2Get Frame FieldsClick button to the Frame fields.
3Include frame row index as an output field checkboxEnable checkbox to Include frame row index as an output field.