My Python Script Is Constantly Executing When I Load It into Teststand

Updated Sep 10, 2019

Reported In

Software

  • TestStand

Issue Details

When I add a Python script to a Python step in TestStand the script is constantly being executed. How do I stop this?

Solution

The script is being executed because the edit-time interpreter is parsing the Python file to find the functions that are available within the module. If you have code that is not contained within a function, the edit-time interpreter will execute this code resulting in unknown behavior. The interpreter may crash requiring a restart of TestStand. To resolve this, encapsulate code into functions that can be called from TestStand and remove any code that executes outside a function. 

WAS THIS ARTICLE HELPFUL?

Not Helpful