NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Python Argument not passed through

Problem: Arguments are empty, when calling python scripts.

 

Teststand: 2014

Python (Anaconda3) : 3.5.2

 

I have veried it a long time ago, with a different version of Python, and at that time it worked.

0 Kudos
Message 1 of 4
(3,279 Views)

It seems i have to set it up diffently now (out of nowwhere!), having the scriptname within the argument...

(this way it works both with Anaconda Python 3.5.2 and "normal windows python 3.5.2")

What have changed ? 

 

Same issue as :

http://forums.ni.com/t5/NI-TestStand/Tourbleshooting-passing-arguments-to-scripts/td-p/3099661

0 Kudos
Message 2 of 4
(3,266 Views)

Hi Nikolaj,

 

Glad you've managed to solve your issue! Yes, you will find you need to set the File Pathname within your step as the location of Python.exe, and the argument expression as "AddNumbersCommandLine.py 2 3 8" i.e. the location of your files followed by the arguments.


The reason for this is explained in the following tutorial: http://www.ni.com/tutorial/8847/en/. It explains at the bottom of section 1 that "If you haven’t associated the script file’s extension with the appropriate interpreter, you will have to call the interpreter directly from the Call Executable step and pass in the script [and any arguments] as a command line argument."

 

Hope this was helpful!

 

Best wishes,

 

Leah

0 Kudos
Message 3 of 4
(3,237 Views)

I have two laptops.

On one i have problems associating .py files to the right program. On that computer this could be the problem.

 

On the other computer the .py files are associated correctly. My script runs when i dobble-click.

In spite of this I have use the "explicit method" for calling it from TS. If i don't it actually runs the script, but the arguments are not passed thorugh.

0 Kudos
Message 4 of 4
(3,181 Views)