I was hoping to integrate python into JMP JSL (version 17.2). I need to do some complex nesting but I can't even seem to do something simple. The scripting index for Python Submit showcases python generating a variable and then it being pulled into JSL using Python Get.
//scripting index 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();
I was hoping to start with something simple like this and then advance to something more advanced:
Python Submit("\[
for i in range(10):;
if i == 6:;
print(i);
]\");
I was expecting the terminal to solely print a six however after running the script the result was a bit bizarre.
//Terminal Output
/**********/
for i in range(10):;
if i == 6:;
print(i);
/**********/
I have tested some more and learned that a couple of things work. But I still can't get nested loops to work.
//Code that seemingly works
Python Submit("print('Hello World')");
Python Submit("for i in range(10): print(i); print(i);");
//Code that doesn't work for some reason
Python Submit("for i in range(10):; if i == 6; print(i)");
Python Submit("for i in range(10): if i == 6: print(i)");
Python Submit("for i in range(10): if i == 6:; print(i););
If anyone has any advice it would be much appreciated.