NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass literal string from NI TestStand to Python

Is there a way to pass a literal string to a Python function in a way, that Python treats it as a r"" string?

I'm using a function that looks more or less like this:


def changeFileContent(fullPathToFile):
# Do something with file
# Return boolean if function is done


I've tried to pass the file path in TestStand as @"\my\path\to\file.txt" and the backslashes are interpreted as symbols. Is there a way to fix this?

Kind regards.
Dave

0 Kudos
Message 1 of 2
(117 Views)

I navigate this scenario by creating a local/file global variable of type string, using it like a constant. When entering the value into a String variable, the escape characters aren't a problem.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 2
(114 Views)