<?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: In this situation, should I use Python or JSL for the main controlling script? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843980#M101774</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7172"&gt;@Paul_Nelson&lt;/a&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Feb 2025 19:38:41 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2025-02-24T19:38:41Z</dc:date>
    <item>
      <title>In this situation, should I use Python or JSL for the main controlling script?</title>
      <link>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843837#M101756</link>
      <description>&lt;P&gt;Now JMP can seamlessly connect with Python, and JSL and Python can call each other.&lt;/P&gt;&lt;P&gt;I have a task:&lt;/P&gt;&lt;P&gt;1. **Receive and extract data (py):** Every minute, use Python code to receive data from an API every 3 seconds. Extract structured data from the received data in real-time and store it in a memory array A. Immediately extract the data into another memory array B. Then, immediately clear memory array A to prepare for the next batch of data (this processing time is sufficient and will not cause blocking). At the end of the minute, use Python code to create a new JMP table (let's call it Table A) and write the structured data from memory array B into this JMP table. Finally, clear memory array B.&lt;/P&gt;&lt;P&gt;2. **Concatenate and stock selection (JSL):** Use JSL to append the data from the newly created JMP Table A to an existing JMP Table B. Perform stock selection calculations using technical indicators in JSL on the combined Table B. Then, close JMP Table A.&lt;/P&gt;&lt;P&gt;This process repeats continuously.&lt;/P&gt;&lt;P&gt;Which of the following two approaches is better for this situation, with a focus on stable operation and reduced system resource consumption?&lt;/P&gt;&lt;P&gt;A. Within a single, overarching Python script, continuously run the data receiving/extraction (py) and the concatenation/stock selection (JSL) portions, using timers.&lt;/P&gt;&lt;P&gt;B. Within a single, overarching JSL script, continuously run the data receiving/extraction (py) and the concatenation/stock selection (JSL) portions, using timers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2025 10:44:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843837#M101756</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2025-02-23T10:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: In this situation, should I use Python or JSL for the main controlling script?</title>
      <link>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843848#M101757</link>
      <description>&lt;P&gt;DeepSeek R1 's&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-02-23_18-48-06.png" style="width: 401px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/73272i3BD757717EF71887/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025-02-23_18-48-06.png" alt="2025-02-23_18-48-06.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2025 10:49:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843848#M101757</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2025-02-23T10:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: In this situation, should I use Python or JSL for the main controlling script?</title>
      <link>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843850#M101758</link>
      <description>&lt;P&gt;grok3&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-02-23_18-53-19.png" style="width: 606px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/73273i8A40D1A0B7E0B586/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025-02-23_18-53-19.png" alt="2025-02-23_18-53-19.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2025 10:54:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843850#M101758</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2025-02-23T10:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: In this situation, should I use Python or JSL for the main controlling script?</title>
      <link>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843948#M101769</link>
      <description>&lt;P&gt;Write two separate programs and leave both running. You could use JMP to launch Python via RunProgram, or Python to launch JMP via whatever Python uses. But start with a .py and a .jsl file and run them manually until it is debugged.&lt;/P&gt;
&lt;P&gt;Make the Python code place completed work in a directory with timestamp filenames. Make it sound an alarm if the work is piling up (because the other worker has failed.)&lt;/P&gt;
&lt;P&gt;Make the JSL code wake up every 10 seconds to use filesInDirectory to look for new work. Make it sound an alarm if it has been &amp;gt;2 minutes since any work was found (because the other worker has failed.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In both Python and JMP cases, the programs are designed to loop forever. You should not make a controller that keeps relaunching them. All the communications is done through the file system, creating and deleting files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is possible there might be a race between the file writer and file reader; if JMP is reading incomplete output, just wait until there are two files available and work on the next-to-last. That will be a minute behind of course.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 16:02:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843948#M101769</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-02-24T16:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: In this situation, should I use Python or JSL for the main controlling script?</title>
      <link>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843976#M101772</link>
      <description>&lt;P&gt;Could I append a (possibly lazy, sorry) question on the same general topic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a large codebase in JSL (10,000+ lines) that does a whole variety of sequential pre-processing, transforming, parsing, and re-organnizing a large automatic, monthly data download I get from my institutional RDBMS's that consists each time of a dozen files in various formats (xml, csv, xls, etc.).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am gradually moving toward retirement and I don't want my code and the very valuable resulting clean, useful JMP database to sink into oblivion. However, my best colleagues to take over the project are all Python programmers and don't really feel emthusiastic about learning JSL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My idea is to factor my JSL code into logical modules of modest size (say ~500 lines of code), each of which performs a well-defined step in the overall process with clearly defined inputs and outputs. THEN, I would wrap each module into some sort of Python wrapper that my colleagues could work with, avoiding having to learn the nitty-gritty details of the JSL. I might also include some Python hooks in the JSL that might allow them to extract basic troubleshooting information when the JSL runs into problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my question: what is the best video, white paper, manual chapter, discussion thread, book, seminar, etc. on this site that could help me (a complete Python newbie) figure out what kinds of hooks and wrappers might be the things I am looking for … with examples of Python code that controls and "sniffs" existing JSL code in this way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe unanswerable question, but any suggestions would be welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 18:37:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843976#M101772</guid>
      <dc:creator>john_madden</dc:creator>
      <dc:date>2025-02-24T18:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: In this situation, should I use Python or JSL for the main controlling script?</title>
      <link>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843980#M101774</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7172"&gt;@Paul_Nelson&lt;/a&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 19:38:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843980#M101774</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-02-24T19:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: In this situation, should I use Python or JSL for the main controlling script?</title>
      <link>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843983#M101775</link>
      <description>&lt;P&gt;These might give some ideas&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;LI-MESSAGE title="JMP is Pythonic! Enhanced Python Integration in JMP 18" uid="723997" url="https://community.jmp.com/t5/JMPer-Cable/JMP-is-Pythonic-Enhanced-Python-Integration-in-JMP-18/m-p/723997#U723997" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;LI-MESSAGE title="Creating JSL functions implemented in Python" uid="750290" url="https://community.jmp.com/t5/JMPer-Cable/Creating-JSL-functions-implemented-in-Python/m-p/750290#U750290" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://community.jmp.com/t5/JMPer-Cable/New-in-JMP-18-Python-jmp-DataTable-and-pandas-DataFrame/ba-p/744680" target="_blank" rel="noopener"&gt; New in JMP® 18: Python jmp.DataTable and pandas.DataFrame&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://community.jmp.com/t5/Abstracts/JMP-and-Python-The-Next-Step/ev-p/708092" target="_blank" rel="noopener"&gt;JMP and Python: The Next Step&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://www.jmp.com/support/help/en/18.0/index.shtml#page/jmp/python.shtml" target="_blank" rel="noopener"&gt;Scripting Guide &amp;gt; Python&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Check things from community written by &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7172"&gt;@Paul_Nelson&lt;/a&gt; &lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And maybe this but start with the ones mentioned earlier&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;LI-MESSAGE title="Scripters Club Recording: Running Python Code within JSL" uid="767254" url="https://community.jmp.com/t5/JMP-Scripters-Club-Discussions/Scripters-Club-Recording-Running-Python-Code-within-JSL/m-p/767254#U767254" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 24 Feb 2025 19:45:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843983#M101775</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-02-24T19:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: In this situation, should I use Python or JSL for the main controlling script?</title>
      <link>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843994#M101777</link>
      <description>&lt;P&gt;Breaking up the JSL into modular well defined and documented components is the biggest and best thing you can do. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Python scripting can do a &amp;nbsp;jmp.run_jsl('' script code ''') so if your routines been made into JSL functions, they can be called from Python. &amp;nbsp;If you want to go deeper, you'll need to learn Python to create Python based objects that behave in a way a Python programmer would expect. &amp;nbsp;If you can make your routines small enough and well documented, the it can be their job to translate from JSL to Python, as long as the algorithm has been well documented. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, the Python support in JMP is advancing with every release, so workarounds necessary in 18 may be handled natively in JMP 19, or 20,.. &amp;nbsp;The current focus in JMP 18, and 19 has been data interoperability. &amp;nbsp;There isn't yet as the Python equivalent of JSL function Python Execute( ), where lists of inputs, outputs and code are sent across the boundary. &amp;nbsp;The best that can be emulated would be doing something like.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import jmp

jmp.run_jsl('''
...
Include("Path_to_file");
v1 = Python Get("py_var1");
v2 = Python Get("py_var2");
result = my_jsl_fn(v1,v2);
Python Send(result);
...
''')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;There is some support in 19 to interoperate from Python by being able to directly get/set global namespace and here namespace variables directly from Python, so the above Python Get() may not strictly be necessary in JMP 19 and beyond. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is good topic for us to look at, better ability expose JSL functions to the Python environment.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 20:08:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/843994#M101777</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2025-02-24T20:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: In this situation, should I use Python or JSL for the main controlling script?</title>
      <link>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/844040#M101778</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;on the need to test each path. &amp;nbsp;When large data and high performance come into play there is no substitute for testing in your environment. &amp;nbsp;No real shortcut to say one is better than the other without testing and making measurements. &amp;nbsp;Even then performance tuning tips and tricks can be specific to each language.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are some general principles. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Do not handle, move, duplicate the data any more than strictly necessary.&lt;/LI&gt;
&lt;LI&gt;Pay attention to O( ) of your code, &amp;nbsp;Unroll loops where possible avoid n^2 or worse algorithms.&lt;/LI&gt;
&lt;LI&gt;Minimize filesystem access in critical areas and make sure memory doesn't grow beyond physical memory or you will be swapping to disk. &amp;nbsp;
&lt;UL&gt;
&lt;LI&gt;Physical RAM vs Local SSD vs HDD vs Network drive.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;In the quest for absolute performance you may need to test sections of your code to see which performs faster, JSL or Python. &amp;nbsp;For example, it may be faster to process data as a numpy array or pandas dataframe and convert to a data table all at once vs appending to a large data table in JSL &lt;EM&gt;(I haven't tested this, so I don't know, I'm just making an example.)&lt;/EM&gt; &amp;nbsp;You need to test each major component of the pipeline when performance is critical.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 20:34:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/844040#M101778</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2025-02-24T20:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: In this situation, should I use Python or JSL for the main controlling script?</title>
      <link>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/844053#M101780</link>
      <description>&lt;P&gt;Thank you!! I've downloaded all of them and will dig down!!!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 21:00:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/844053#M101780</guid>
      <dc:creator>john_madden</dc:creator>
      <dc:date>2025-02-24T21:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: In this situation, should I use Python or JSL for the main controlling script?</title>
      <link>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/844054#M101781</link>
      <description>&lt;P&gt;Paul, thanks so much. Your comments tell me I am somewhere in the correct ballpark. I am SO appreciative of all you are doing for the JMPing Pythons (or Pythonic JMpers) out there. I'm positive there are a lot of big, established legacy JSL projects out there in this situation of not wanting to be rewritten, but needing to add mechanisms to "unzip their fly" as it were (forgive me) for Python folk to peek inside.&lt;/P&gt;&lt;P&gt;Gratefully, John&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 21:07:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/844054#M101781</guid>
      <dc:creator>john_madden</dc:creator>
      <dc:date>2025-02-24T21:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: In this situation, should I use Python or JSL for the main controlling script?</title>
      <link>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/844136#M101788</link>
      <description>&lt;P&gt;Thank you all experts for your answers.&lt;/P&gt;&lt;P&gt;I conducted a comparison between Python and JSL for a complex indicator calculation.&lt;BR /&gt;The time consumption differs by nearly 10 times.&lt;BR /&gt;I ran the full matrix when using JSL.&lt;BR /&gt;Since I'm not familiar with Python, I could only ask various AIs to implement it in Python according to this JSL logic.&lt;BR /&gt;The result shows that the modification by grok3 is the best.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-02-25_10-45-40.png" style="width: 917px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/73317i05E2B4D0330BE59C/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025-02-25_10-45-40.png" alt="2025-02-25_10-45-40.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 03:00:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/In-this-situation-should-I-use-Python-or-JSL-for-the-main/m-p/844136#M101788</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2025-02-25T03:00:16Z</dc:date>
    </item>
  </channel>
</rss>

