NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Local cache of python script

Solved!
Go to solution

Hi All,

 

When creating a step which uses the python adapter, it seems a local copy of the python script is made.

 

This can be proven in the following way:

- Create a python script with this code:

def testFunc():
    return 1
- Call this from the step using the python adapter. The result of calling the function will be 1.
- Now change the python code to:
def testFunc():
    return 2
- On the python step, click 'reload module and prototype'.
- Run the step again. The result will still be 1.
 
Is there a way to see (and empty) this cache? It would be a shame to have to create a new python file everytime a change is made.
 
Thanks in advance!
 
TestStand Engine Version 23.0.0
Sequence Editor version 2026 Q1 (26.0) 64 bit
0 Kudos
Message 1 of 2
(209 Views)
Solution
Accepted by topic author DrDonut21

Okay, found the answer, but I will leave it here as a reference:

 

The problem wasn't that TestStand keeps some local copy of the python file, it was that the python interpreter keeps it cached.

 

This can be avoided by reloading it on each execution. To do this, go to Configure-> Adapters. Select Python. Configure. And then check the box 'Reload modified modules before execution'

Message 2 of 2
(193 Views)