Skip to main content
LoganPrice
Most Valuable Pathfinder
Most Valuable Pathfinder
January 4, 2022
Question

Strange Python Behavior

  • January 4, 2022
  • 2 replies
  • 125 views

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

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
    Most Valuable Pathfinder
    January 4, 2022

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

    Automate Everything
    Ashwin A.K
    Navigator | Tier 3
    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

     

    Blogs at TheCodingTheory - https://www.thecodingtheory.com