<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JMP 17 and Python in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-17-and-Python/m-p/771526#M95215</link>
    <description>&lt;P&gt;If you are able to update to JMP18 you will save yourself from a lot of possible headache due to the new way of handling Python in JMP.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jul 2024 04:25:15 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-07-09T04:25:15Z</dc:date>
    <item>
      <title>JMP 17 and Python</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-17-and-Python/m-p/771464#M95210</link>
      <description>&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//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();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I was hoping to start with something simple like this and then advance to something more advanced:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Python Submit("\[
for i in range(10):;
if i == 6:;
print(i);
]\");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I was expecting the terminal to solely print a six however after running the script the result was a bit bizarre.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Terminal Output&lt;BR /&gt;/**********/&lt;BR /&gt;&lt;BR /&gt;for&amp;nbsp;i&amp;nbsp;in&amp;nbsp;range(10):;&lt;BR /&gt;if&amp;nbsp;i&amp;nbsp;==&amp;nbsp;6:;&lt;BR /&gt;print(i);&lt;BR /&gt;/**********/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have tested some more and learned that a couple of things work. But I still can't get nested loops to work.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//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)");&lt;BR /&gt;Python&amp;nbsp;Submit("for&amp;nbsp;i&amp;nbsp;in&amp;nbsp;range(10):&amp;nbsp;if&amp;nbsp;i&amp;nbsp;==&amp;nbsp;6:;&amp;nbsp;print(i););&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If anyone has any advice it would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 21:39:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-17-and-Python/m-p/771464#M95210</guid>
      <dc:creator>Owen</dc:creator>
      <dc:date>2024-07-08T21:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 17 and Python</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-17-and-Python/m-p/771498#M95211</link>
      <description>&lt;P&gt;Here is the Submit structures in the JMP 17 interface to Python that I found that work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Python Init();
Python Submit("\[
for i in range(11):
   if i == 6: 
      print(i)
      print(i)
]\");
Python Submit("i=6
if i == 6: print(i); print('i is 6')
");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2024 01:13:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-17-and-Python/m-p/771498#M95211</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-07-09T01:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 17 and Python</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-17-and-Python/m-p/771526#M95215</link>
      <description>&lt;P&gt;If you are able to update to JMP18 you will save yourself from a lot of possible headache due to the new way of handling Python in JMP.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 04:25:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-17-and-Python/m-p/771526#M95215</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-09T04:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 17 and Python</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-17-and-Python/m-p/771669#M95224</link>
      <description>&lt;P&gt;Looks like you overlooked the indentations needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Python Submit("\[
for i in range(10):
	if i == 6:
		print(i)
]\");&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//6&amp;nbsp;(then&amp;nbsp;0&amp;nbsp;when&amp;nbsp;Python&amp;nbsp;is&amp;nbsp;successfully&amp;nbsp;terminated)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2024 13:09:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-17-and-Python/m-p/771669#M95224</guid>
      <dc:creator>mmarchandFSLR</dc:creator>
      <dc:date>2024-07-09T13:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 17 and Python</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-17-and-Python/m-p/771681#M95226</link>
      <description>&lt;P&gt;I didn't realize that indentation had such a large impact in jmp. Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 14:17:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-17-and-Python/m-p/771681#M95226</guid>
      <dc:creator>Owen</dc:creator>
      <dc:date>2024-07-09T14:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 17 and Python</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-17-and-Python/m-p/771682#M95227</link>
      <description>&lt;P&gt;It doesn't have an impact in JMP but it does have an impact in Python (you are running Python code not JSL).&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 14:20:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-17-and-Python/m-p/771682#M95227</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-09T14:20:30Z</dc:date>
    </item>
  </channel>
</rss>

