Solution
When configuring the Python Adapter in TestStand, you can choose how the Python interpreter is managed during execution. The available options are:
- Global: The Interpreter session created has the same lifetime of the TestStand application. To close it without exiting the application, go to: File > Unload All Modules.
- Per Execution: The Interpreter session created has the lifetime of the execution.
- Per Thread: The Interpreter session created has the lifetime of the thread.

Additionally, you can override the adapter configuration at the step level using the Advanced Settings. This allows you to select an option called Object Reference, which uses an interpreter session referenced by a variable. This session also follows the lifetime of the execution, but you can programmatically close it by assigning Nothing to the variable holding the reference.