How to pass variables as parameters in the “invoke python method” in UiPath
I used a For Each file in Folder loop, I am getting each file. How do i pass this file as a input parameterto the “invoke python method” in Python activities in UiPath.
Is there something wrong with my python scope , I put a message box inside “Do” but still it doesnt get printed.
I feel my python scope is the issue
Can you show me the folder at which python is installed?
By default it will be something like this:
C:\Users<Username>\AppData\Local\Programs\Python\Python310
Use library path as: “C:\Users<USERNAME>\AppData\Local\Programs\Python\Python310\python310.dll”
Use path as: “C:\Users<USERNAME>\AppData\Local\Programs\Python\Python310\python.exe”
Looks like the path is wrong…
Please check this step by step guide
https://docs.uipath.com/activities/other/latest/user-guide/invoking-a-python-script
cheers
-
Library path → This should be the path to the .dll file
-
Path → This should be the path to the FOLDER containing python.exe
Example:
-
To send parameters into a Python method from UiPath, send in an array of variables where the position of variables are the same as the position of arguments in the Python method, e.g.
def sum(arg_a, arg_b, arg_c):
return arg_a + arg_b + arg_c
- Then your UiPath code would be as below. Take note to add a Load Python Script activity pointing at your .py file before using Invoke Python Method
See this guys , my scope is fine right , but still the message box inside ‘Do’ is not printing when i run , please guide me
Please try installing .Net 5.0 runtime.
After installing, try re-run the bot.
Any logs generated when you run?
no logs are generated
Can you share your workflow? Also take a screenshot of the Output panel when the robot runs?