We might sometimes think of writing python scripts to automate few tasks or to achieve some desired results.
let’s see how to do that…!!!
Mandatory: UiPath.Python.Activities package
Implementation using UiPath :
Let us implement a workflow which takes name and country and displays a proper welcome message using a python script.
Drag “Python Scope” activity into the designer panel and set the required parameters.
Your python installed path i.e. “C:\Users\sharathm\AppData\Local\Programs\Python\Python36”
Select your current version .i.e 3.6,3.5,2.7…
Drag “Load Python Script” activity into the designer panel to load the python script and supply the below parameters.
File: Your python script path
Result: Create a PythonObject type variable and pass it here
Our Python Script:
Load Python Script Activity:
Drag “Invoke Python Method” activity into the designer panel and supply the function name that we want to invoke with the required arguments to it.
Function Name: Welcome
Here we have used two arguments i.e
Drag “Get Python Object” activity into the designer panel to convert the python Object obtained from the above activity to our desired datatype (In our case its “string” type)
Drag “Message Box” activity to display the welcome message obtained from the script.
Finally, execute the workflow 🙂
Click here to download the Source Code…
Hope it has helped you…
2 thoughts on “How To Execute Python Script – In UiPath”
install your source code and get error –> Load Python Script: Error loading Python script. 🙁
So, which version of python are you using currently?