concatenating a variable into a python stringIts been a while since I've really messed with this stuff, but having some issues with the Python Submit function. Take the following code
Names Default To Here( 1 );
Python Init();
Python Submit( "\[
str = 'The quick brown fox jumps over the lazy dog';
a = 200;
]\" );
getStr = Python Get( str );
getNum = Python Get( a );
Show( getStr, getNum );
Python Term();
If I wanted to make the word "fox" a variable I would have thought it was just a matter of concatenating a variable into the string, but for whatever reason I can't seem to break that string? Maybe it's because it's a list of strings? I feel like this is an obvious one but for whatever reason I'm missing it.
Data AccessRe: concatenating a variable into a python stringI assume you are not using JMP18 (but it shouldn't matter). I'm not sure what issue you are having? You are sending one string and one numeric value to Python and then printing them in JMP which should work fine.
JMP18

Re: concatenating a variable into a python stringMaybe something like this?
Names Default To Here( 1 );
fox = "python";
Python Init();
Python Submit( evalinsert("\[
str = 'The quick brown ^fox^ jumps over the lazy dog';
a = 200;
]\") );
getStr = Python Get( str );
getNum = Python Get( a );
Show( getStr, getNum );
Python Term();Re: concatenating a variable into a python stringThat appears to do it. Any idea why it uses the carrat for that as opposed to just escaping with quotes?
Re: concatenating a variable into a python stringEvalInsert is a JMP JSL function that uses ^ as the default delimiter for the insert. Here is the JMP Scripting Index entry for the description of the function

The substitution of Fox is performed in JMP before being passed to Python
Re: concatenating a variable into a python stringYou could also do it this way:
Names Default To Here( 1 );
fox = "python";
Python Init();
Python Submit( evalinsert("
str = 'The quick brown " || fox || " jumps over the lazy dog';
a = 200;") );
getStr = Python Get( str );
getNum = Python Get( a );
Show( getStr, getNum );
Python Term();
evalinsert offers a cleaner method, IMHO.