Python scripting and uipath?

Hi there,

Is there a possibility to execute scripts from python, without returning a value ? For example I want to create some txt file in my python script and then ivoke it in uipath sequence. I tried many ways and did not succeed. Thanks for advance.

You can run the script with a dummy return value @ledi12

Just enter the line return “Success” , thats it

This is my python code:

with open(“file.txt”, “w”) as file:
file.write(“hi ui path”)

this creates the txt file and writes the line “hi uipath”. How can I invoke this in uipath, which method should I use ? @HareeshMR

Then simple Load python script or run python script is enough @ledi12

This will be the code

with open(“file.txt”, “w”) as file:
file.write(“hi ui path”)

That should be written directly in the activity or stored in a text file and then run it

and this is the workflow

image

This will run and write the text to the file

1 Like

cool, thanks :slight_smile:

@HareeshMR Just found some time to check it out. Unfortunately txt file is not being created ;(

Are you getting any error @ledi12?

no, script runs however file is not being created @HareeshMR

Can you check giving the entire full path of the file in the code @ledi12?

It is creating for me