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

–1 vote
How can I use Python Activities pack to build and run a python program in UiPath Studio?
Apr 9, 2019 in RPA by Utkarsh
6,845 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, 2019 by Abha
• 28,140 points

Related Questions In RPA

0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer

What are Packages in UiPath Orchestrator and how can I manually upload a package to Orchestrator?

Hey @Erik, The Packages page displays all the ...READ MORE

answered Apr 5, 2019 in RPA by Anvi
• 14,150 points
10,051 views
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, 2019 in RPA by Pratibha
• 3,690 points
2,646 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, 2019 in RPA by Anvi
• 14,150 points
998 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 14, 2019 in RPA by Abha
• 28,140 points
3,057 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, 2019 in RPA by Anvi
• 14,150 points
8,206 views
+2 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, 2019 in RPA by Pratibha
• 3,690 points
17,192 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 14, 2019 in RPA by Abha
• 28,140 points
16,788 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP