Solved

Python returns Bot error while running the execute script command

  • 2 March 2023
  • 8 replies
  • 665 views

Badge +2

I’m trying to run a python script as import file command. it simple give me a message as bot error but when i run the same script in IDE it works fine and generates the expected output. not sure what was missing while using AA command. Adding the code snippet for reference

f = open("samplefile1.txt", "w")
f.write("Hello World from python")
f.close()
 

icon

Best answer by Raul Jaimes 2 March 2023, 09:17

View original

8 replies

Userlevel 7
Badge +13

Hi @rajeshramu ,

 

Can you share the Execute Python action’s screenshot?

Badge +2

 

Userlevel 7
Badge +13

 

 

Kindly share the details of Execute Script part.

 

Badge +2

Hi Padmakumar, 

Nothing much in execute command just the session name and output variable.

 

Userlevel 7
Badge +13

Hi Padmakumar, 

Nothing much in execute command just the session name and output variable.

 

 

Ok.  Refer this article and follow any of the workaround suggested and see whether it is helping or not.

 

Userlevel 5
Badge +9

@rajeshramu 

It worked for me with the absolute path and “/” instead of “\”

f = open("C:/test/samplefile1.txt", "w")

f.write("Hello World from python")

f.close()

 

 

HTH

Regards

Badge +2

@Raul Jaimes Thanks a lot!! it worked now.. earlier i tried the absolute path before but using backward slash. 

Badge +2

Hi Padmakumar, 

Nothing much in execute command just the session name and output variable.

Thanks Padmakumar for sharing the article as well.

 

 

Ok.  Refer this article and follow any of the workaround suggested and see whether it is helping or not.

 

 

Reply