Hello Everyon
I want to run a very simple python file from UiPath.
Print(“Hello world”)
I have tried a lot but it does not work!
One time, I selected the run python script activity inside a python scope activity.
Another time, I tried to make a function first. Then make a load python script activity. Then, Invoke Python activity. Then, Get Python object, Then, Message box.
However, this idea did not work for me as well.
Does anyone know how can I make an integration between python and UiPath ?
Thank you for your reply!
I have installed the python as well as dotnet runtime 6 on my system. In addition, on the UiPath, the python acitivities is installed.
Is there any specific activity package in the UiPath, relating to the .Net, I need to install as well ?
Your script might be working but print(“Hello World”) will not give you an output in UiPath environment. For that you need to return a value from a function and call that function from UiPath.
For example:
Python Code -
def myFunc():
return "Hello World"
→ Now inside UiPath Studio, use Python Container, inside the container call this python script using load python script activity.
→ Now in the load python script activity give the name of the function, i.e. “myFunc”.
→ Now use Get Python Object activity and set the type argument to System.String
The key point is inorder to get a value out of your python script in UiPath environment, you should return that value using a function.
If it’s small script you can take screenshot by Snipping tool and directly paste in the reply text box otherwise you can click on Upload button to share files.
This is my simple python code which just opens the cmd and maximize it on my screen.
I can run it by VSCODE, meaning that the code is correct. But, it does not execute from the UiPath.