How can I use Python Activities pack to build and run a python program in UiPath Studio?

0 votes
How can I use Python Activities pack to build and run a python program in UiPath Studio?
Apr 9 in RPA by Utkarsh
407 views

1 answer to this question.

0 votes

Hi Utkarsh, if you want to use Python package, you can build an automation process to invoke a Python script which defines two operations, Add and Subtract. One of the methods, Add, is then called from the script and given a list of integer variables as input parameters. The result then, stored in a PythonObject variable, is then converted into a .NET datatype to be further used in Studio. Follow these steps to build this demo:

  1. Open Studio and start a new Process.
  2. Drag a Python Scope activity to the Workflow Designer. Specify the installation directory of Python in the Path property of the Python Scope activity.
  3. Drag a Load Python Script activity in the Do section of the Python Scope and add the file path to the MathOperations.py (create a python file) Python script in the File property.
  4. Create a new PythonObject variable, called MathFunctions and add it into the Result property field.
  5. Add an Invoke Python Method activity and configure its properties as follows:
    • Input Parameters - {2,3}
    • Instance - Add the variable created at step 5, MathFunctions, to this field.
    • Name - Add the name of the method inside the script you want to use, in this case add.
    • Result - Create a new PythonObject variable, called SumResultPython, and add it to this property field.
  6. Next, drag a Get Python Object activity to the workflow. Configure its properties as follows:
    • Python Object - Add the SumResultPython variable to this field.
    • TypeArgument - Select Int32 from the drop-down list.
    • Result - Create a new Int32 variable, called Result and add it to this field.
  7. Add a Message Box activity at the end of the project and configure it to display the Result variable.
answered Apr 9 by Abha
• 15,680 points

Related Questions In RPA

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

What is Terminal Activities pack and how it can be used in UiPath studio?

Hello Lalit, the Terminal pack contains activities ...READ MORE

answered Apr 9 in RPA by Pratibha
• 2,740 points
102 views
0 votes
1 answer

Which all activities comes under Python Activities pack and what they are used for?

Hey @Jasmine, the Python Activities pack enables ...READ MORE

answered Apr 9 in RPA by Anvi
• 9,990 points
38 views
0 votes
1 answer

What is Get Jobs activity used for in UiPath Studio?

Hey @Rakesh, Get Jobs Activity can be ...READ MORE

answered Mar 13 in RPA by Abha
• 15,680 points
153 views
0 votes
1 answer

How to format text in notepad using UiPath?

Hey @Rashmi, if you want to automate ...READ MORE

answered Mar 18 in RPA by Anvi
• 9,990 points
532 views
0 votes
1 answer

How can I display current date in "dd-MMM-yy" format in UiPath Studio?

Hi Shilpa, if you want to display ...READ MORE

answered Mar 18 in RPA by Pratibha
• 2,740 points
1,060 views
0 votes
1 answer

Can I create dictionary in UiPath studio and add items to it?

Hey @Rumani, you can definitely create dictionary ...READ MORE

answered Mar 13 in RPA by Abha
• 15,680 points
794 views
0 votes
1 answer

How can I include any dependency or library to a UiPath project?

Hey @Praharsh, in order to manage the ...READ MORE

answered Mar 6 in RPA by Abha
• 15,680 points
111 views