Skip to main content
Question

Strange Python Behavior


LoganPrice
Most Valuable Pathfinder
Forum|alt.badge.img+12

===================================

Community Edition - Bot Agent Version 21.120.

Windows 10

====================================

 

Hello All,

 

I am just starting to try Python in AA and have encountered some strange behavior.

 

I have three commands in a task as shown:

imageThe Open script command contains the following inline Python:

imageThe Execute script action outputs the script to "pyOutput" string, and the Message box action displays the "pyOutput" string.

 

The strange part is that when I run the bot, I get a message from the bot of "true" on line 1, which is the Open script action.

imageHowever, after clicking "Close" the bot finishes and no message box (which is the third action in my bot) is displayed.

 

Any idea what I am doing wrong here?

 

Thanks!

2 replies

LoganPrice
Most Valuable Pathfinder
Forum|alt.badge.img+12
  • Author
  • Most Valuable Pathfinder
  • 77 replies
  • January 4, 2022

Worked like a charm @Ashwin A.K​ ! Thanks!


Ashwin A.K
Forum|alt.badge.img+8
  • Navigator | Tier 3
  • 2445 replies
  • January 4, 2022

Hi @Logan Price​ ,

 

Since you are passing in the script manually, you have to use the Python Script: Open Function along with the Function you wish to execute and the Arguments if any.

 

image 

image 

image 

The Python Script: Execute Script is used when you are referencing a py file in the Python Script: Open Action.

 

Kind Regards,

Ashwin A.K

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings