10-14-2016 05:40 AM
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.
10-14-2016 06:57 AM
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
10-17-2016 06:36 AM - edited 10-17-2016 06:38 AM
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
10-21-2016 03:36 AM
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.