Configure the Python connector
Write and validate custom Python scripts and execute them as part of your automation by using the Python connector in RPA Desktop Design Studio.
Before you begin
Ensure you have installed the Scripting plugin on the RPA Desktop Design Studio. To install, see Manage plugins in RPA Desktop Design Studio.
Ensure that a Python version is installed on your machine which is a part of the environment variables. For more information about environment variables, see Setting environment variables.
Familiarize yourself with the limitations of Python script. For more information, see Limitations of Python script in Python connector.
Role required: none
Procedure
Temperature conversion and weather advice
Perform the following steps to execute the automation for temperature conversion and weather advice.
- In the Toolbox pane, navigate to .
- Drag Variable component to the design surface.
- Double-click the Variable component and set these parameters as shown in the image.
Figure 2. Parameters for Variable Container - Double-click the Python connector in the Global Objects.
- Drag the Execute method from Object Explorer to design surface.
- Select the component and click the method settings icon (
) or double-click the component head bar.
- Select the Show Functions check box and select the celsius_to_fahrenheit function from the Functions list.
- Select OK.
- Drag the Execute method again from Object Explorer to design surface.
- Select the Show Functions check box and select the celsius_to_fahrenheit function from the Functions list.
- Select WeatherAdvisor option from the Classes list.
- Select give_advice option from the Methods list.
- Select OK.
- Connect the ports of the components as shown in the following image.
Figure 3. Ports connection for Variable component and Execute methods - To test the component, right-click the Variable component and select Run From Here.
Figure 4. Example result for temperature Figure 5. Example result for weather advice