<?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: How this JSL conversion to base 36 is done in python. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796482#M97268</link>
    <description>&lt;P&gt;The fundamental issue you are missing is that the JSL environment and the Python Environment have different variable scopes. &amp;nbsp;Within JSL, names go into the global namespace when Names Default To Here(0); or not specified. &amp;nbsp;They are in the 'here' namespace when Names Default To Here(1); or they are within a particular namespace if you choose to create another namespace via JSL. &amp;nbsp;Further special things like :age are checked if they are column references of the current data table. &amp;nbsp;This is on the JSL side of the boundary. &amp;nbsp;On the Python side, variables created in Python wind up in the Python dictionary of the appropriate scope. &amp;nbsp;In the globals() dictionary for the body of the script. Each module, function, ... has its own local dictionary. &amp;nbsp;Python and JSL do not automatically share the variables with one another. &amp;nbsp;This requires an action on your part to 'send' a JSL variable to the Python environment or 'get' a Python value back into the JSL environment. &amp;nbsp;For that purpose Python Send( v ) takes the JSL value v and creates a Python variable named v with a copy of the value of v. &amp;nbsp;A few special types like data tables and matrices are passed as a reference to the actual object instead of a copy. &amp;nbsp;But most values come across as a copy. &amp;nbsp;jV = Python Get( pV ) ; &amp;nbsp;Looks up the pV variable in the Python environment and copies the value to the JSL variable jV. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;mentioned there is plenty of JMP documentation that talks about this functionality. &amp;nbsp;The send() / get() capability has been fundamental with the Python Integration beginning with JMP 14. Please spend time exploring our documentation and sample scripts. &amp;nbsp;The Scripting Index found from the Help menu is builtin JMP documentation for JSL and Python. &amp;nbsp;Within the Scripting Index, 'All Categories' shows everything, with a search field next to it. &amp;nbsp;Search of Python will quickly show all the JSL Python functionality with descriptions and runnable samples. &amp;nbsp;If you chose the 'Python' category, it filters to show all the new JMP 18+ functionality supported from the Python environment. &amp;nbsp; Here you will find descriptions and runnable examples showing the functionality of the JMP 18+ Python side of the integration. &amp;nbsp; &amp;nbsp;Lastly, from the Python environment, doc strings have been utilized so you can use Python's builtin help functionality. &amp;nbsp;help( jmp.DataTable ) for example&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Paul_Nelson_0-1725722269962.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68017i29909387B143E958/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Paul_Nelson_0-1725722269962.png" alt="Paul_Nelson_0-1725722269962.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Paul_Nelson_1-1725722313890.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68018i7ED22E66CC0FAC0C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Paul_Nelson_1-1725722313890.png" alt="Paul_Nelson_1-1725722313890.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Paul_Nelson_2-1725723439163.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68019iC962F82BAC01B779/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Paul_Nelson_2-1725723439163.png" alt="Paul_Nelson_2-1725723439163.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you have found, the flexibility of Python packages allows you create your own ways of passing data. &amp;nbsp;Spending time with our documentation and samples provided. &amp;nbsp;Play with them and learning how they function, will go a long way to clearing up how to best utilize JMP's Python integration. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an aside, using Chat GPT or other AI tools to write code is only truly useful if you know how the code is supposed to work. &amp;nbsp;It's just like trusting a website article, you need to know enough of how things work ( Python, JSL, ... ) to have an idea of whether the code you get is accurate, almost working, gets the concepts right, or just complete disinformation. &amp;nbsp;Finally, &amp;nbsp;AI knowledge of the current JMP 18+ Python integration is likely to be a lot smaller than information on JMP 14-17 simply due to the newness of JMP 18. &amp;nbsp;I am confident that the best source of information is our documentation, our Scripting Index and the included $SAMPLE_SCRIPTS directories.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 07 Sep 2024 15:58:38 GMT</pubDate>
    <dc:creator>Paul_Nelson</dc:creator>
    <dc:date>2024-09-07T15:58:38Z</dc:date>
    <item>
      <title>How this JSL conversion to base 36 is done in python.</title>
      <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796012#M97242</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt; 
txt = Hex( (Today() - Informat( "01/01/1970", "mm/dd/yyyy" ) - In Hours( 8 )) * 1000 + 600000 + Day( Today() ), base( 36 ) );


a = Today();
b = Informat( "01/01/1970", "mm/dd/yyyy" );
c = In Hours( 8 );
d = Day( Today() );
e = (a - b - c) * 1000 + 600000 + d;
f = Hex( (a - b - c) * 1000 + 600000 + d, base( 36 ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class=""&gt;I asked ChatGPT several times and the results were inconsistent with the JSL results.&lt;/SPAN&gt;&lt;SPAN class=""&gt;Only ask for help from experts who are familiar with both JSL and python.&lt;/SPAN&gt;&lt;SPAN class=""&gt;Thank you very much!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 10:51:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796012#M97242</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-06T10:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: How this JSL conversion to base 36 is done in python.</title>
      <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796146#M97248</link>
      <description>&lt;P&gt;Which part are you having problems with? Building the number to convert? Or the conversion?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 14:43:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796146#M97248</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-09-06T14:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: How this JSL conversion to base 36 is done in python.</title>
      <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796152#M97249</link>
      <description>&lt;P&gt;Is your understanding of this function in JSL&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;txt = Hex( (Today() - Informat( "01/01/1970", "mm/dd/yyyy" ) - In Hours( 8 )) * 1000 + 600000 + Day( Today() ), base( 36 ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;how can you calculate the same result in python&lt;BR /&gt;I also don't understand Informat("01/01/1970", "mm/dd/yyyy").So we don't know where ChatGPT's answer is.&lt;BR /&gt;It calculates the result of a Token, if the calculation is not correct.POST download is not possible.In fact, python calculations cannot be downloaded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ChatGPT&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import datetime

# Step 1: Current time (China's East 8 time zone)
now = datetime.datetime.now()

# Step 2: Date of January 1, 1970
epoch = datetime.datetime(1970, 1, 1)

# Step 3: Calculate the difference in seconds between the current time and January 1, 1970, and subtract 8 hours
time_diff = (now - epoch).total_seconds() - (8 * 3600)

# Step 4: Convert the time difference to milliseconds, add 600,000, and add today's day of the month
milliseconds = time_diff * 1000
e = milliseconds + 600000 + now.day

# Step 5: Convert the result to a base-36 representation
def to_base36(num):
    chars = '0123456789abcdefghijklmnopqrstuvwxyz'
    base36 = ''
    while num &amp;gt; 0:
        num, i = divmod(int(num), 36)
        base36 = chars[i] + base36
    return base36

# Output the base-36 value
result = to_base36(e)
print("Python calculated result:", result)

# Output the current precise timestamp
print("Current timestamp:", now)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Sep 2024 15:01:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796152#M97249</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-06T15:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: How this JSL conversion to base 36 is done in python.</title>
      <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796157#M97250</link>
      <description>&lt;P&gt;If you don't understand the first part, you have to start with that. In Format converts a string to a JMP datenum using specified format/pattern&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1725635158322.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/67994i5D772B526E2EB3D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1725635158322.png" alt="jthi_0-1725635158322.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Which in your case is 2082844800. Also, if you are using JMP, why would you perform the conversion in Python? You can just run JSL in Python using run_jsl&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 15:09:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796157#M97250</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-09-06T15:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: How this JSL conversion to base 36 is done in python.</title>
      <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796308#M97262</link>
      <description>&lt;P&gt;Google search:&amp;nbsp;Python base36&lt;/P&gt;
&lt;P&gt;gives the following for base36 conversion including a 2-line solution using numpy.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/1181919/python-base-36-encoding" target="_blank"&gt;https://stackoverflow.com/questions/1181919/python-base-36-encoding&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of many search results for Python and base36.&lt;/P&gt;
&lt;P&gt;Also understand that Python's Epoch date is 1 Jan 1970. &amp;nbsp;If you are getting JMP's raw date value the Epoch date is 1 Jan 1904. &amp;nbsp;Also, when doing direct time conversions on the seconds, make sure you also account for leap years.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 22:48:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796308#M97262</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2024-09-06T22:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: How this JSL conversion to base 36 is done in python.</title>
      <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796383#M97265</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;How does this JSL in python pass to python?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I'll just go through the paste board&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-09-07_14-43-44.png" style="width: 816px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68014iEF0883424898CF02/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-09-07_14-43-44.png" alt="2024-09-07_14-43-44.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2024 06:45:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796383#M97265</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-07T06:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: How this JSL conversion to base 36 is done in python.</title>
      <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796448#M97266</link>
      <description>&lt;P&gt;There is no need to use clipboard to move information between jmp and python in JMP ( suggest you read through &lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/python.shtml#" target="_blank"&gt;https://www.jmp.com/support/help/en/18.0/#page/jmp/python.shtml#&lt;/A&gt; ).&lt;/P&gt;
&lt;PRE&gt;import jmp

txt = "initial";
print(txt);

jmp.run_jsl("""
	txt = "hello world";
	Python Send(txt);
""")
print(txt);&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1725715446331.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68015i3FF33984D3C0CA4B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1725715446331.png" alt="jthi_0-1725715446331.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2024 13:25:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796448#M97266</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-09-07T13:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: How this JSL conversion to base 36 is done in python.</title>
      <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796459#M97267</link>
      <description>&lt;P&gt;I an not&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-09-07_21-50-57.png" style="width: 830px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68016iB5877516EC16BCDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-09-07_21-50-57.png" alt="2024-09-07_21-50-57.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2024 14:30:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796459#M97267</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-07T14:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: How this JSL conversion to base 36 is done in python.</title>
      <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796482#M97268</link>
      <description>&lt;P&gt;The fundamental issue you are missing is that the JSL environment and the Python Environment have different variable scopes. &amp;nbsp;Within JSL, names go into the global namespace when Names Default To Here(0); or not specified. &amp;nbsp;They are in the 'here' namespace when Names Default To Here(1); or they are within a particular namespace if you choose to create another namespace via JSL. &amp;nbsp;Further special things like :age are checked if they are column references of the current data table. &amp;nbsp;This is on the JSL side of the boundary. &amp;nbsp;On the Python side, variables created in Python wind up in the Python dictionary of the appropriate scope. &amp;nbsp;In the globals() dictionary for the body of the script. Each module, function, ... has its own local dictionary. &amp;nbsp;Python and JSL do not automatically share the variables with one another. &amp;nbsp;This requires an action on your part to 'send' a JSL variable to the Python environment or 'get' a Python value back into the JSL environment. &amp;nbsp;For that purpose Python Send( v ) takes the JSL value v and creates a Python variable named v with a copy of the value of v. &amp;nbsp;A few special types like data tables and matrices are passed as a reference to the actual object instead of a copy. &amp;nbsp;But most values come across as a copy. &amp;nbsp;jV = Python Get( pV ) ; &amp;nbsp;Looks up the pV variable in the Python environment and copies the value to the JSL variable jV. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;mentioned there is plenty of JMP documentation that talks about this functionality. &amp;nbsp;The send() / get() capability has been fundamental with the Python Integration beginning with JMP 14. Please spend time exploring our documentation and sample scripts. &amp;nbsp;The Scripting Index found from the Help menu is builtin JMP documentation for JSL and Python. &amp;nbsp;Within the Scripting Index, 'All Categories' shows everything, with a search field next to it. &amp;nbsp;Search of Python will quickly show all the JSL Python functionality with descriptions and runnable samples. &amp;nbsp;If you chose the 'Python' category, it filters to show all the new JMP 18+ functionality supported from the Python environment. &amp;nbsp; Here you will find descriptions and runnable examples showing the functionality of the JMP 18+ Python side of the integration. &amp;nbsp; &amp;nbsp;Lastly, from the Python environment, doc strings have been utilized so you can use Python's builtin help functionality. &amp;nbsp;help( jmp.DataTable ) for example&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Paul_Nelson_0-1725722269962.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68017i29909387B143E958/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Paul_Nelson_0-1725722269962.png" alt="Paul_Nelson_0-1725722269962.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Paul_Nelson_1-1725722313890.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68018i7ED22E66CC0FAC0C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Paul_Nelson_1-1725722313890.png" alt="Paul_Nelson_1-1725722313890.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Paul_Nelson_2-1725723439163.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68019iC962F82BAC01B779/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Paul_Nelson_2-1725723439163.png" alt="Paul_Nelson_2-1725723439163.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you have found, the flexibility of Python packages allows you create your own ways of passing data. &amp;nbsp;Spending time with our documentation and samples provided. &amp;nbsp;Play with them and learning how they function, will go a long way to clearing up how to best utilize JMP's Python integration. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an aside, using Chat GPT or other AI tools to write code is only truly useful if you know how the code is supposed to work. &amp;nbsp;It's just like trusting a website article, you need to know enough of how things work ( Python, JSL, ... ) to have an idea of whether the code you get is accurate, almost working, gets the concepts right, or just complete disinformation. &amp;nbsp;Finally, &amp;nbsp;AI knowledge of the current JMP 18+ Python integration is likely to be a lot smaller than information on JMP 14-17 simply due to the newness of JMP 18. &amp;nbsp;I am confident that the best source of information is our documentation, our Scripting Index and the included $SAMPLE_SCRIPTS directories.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2024 15:58:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796482#M97268</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2024-09-07T15:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: How this JSL conversion to base 36 is done in python.</title>
      <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796682#M97272</link>
      <description>&lt;P&gt;Thank &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7172" target="_blank" rel="noopener"&gt;Paul&lt;/A&gt;!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-09-08_07-56-25.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68024i2093B2F0B6FCC681/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-09-08_07-56-25.png" alt="2024-09-08_07-56-25.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2024 23:58:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796682#M97272</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-07T23:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: How this JSL conversion to base 36 is done in python.</title>
      <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796684#M97273</link>
      <description>&lt;P&gt;Thanks Experts!&lt;/P&gt;&lt;P&gt;OK&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-09-08_09-10-34.png" style="width: 374px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68025i6F329B09132D1EDC/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-09-08_09-10-34.png" alt="2024-09-08_09-10-34.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Sep 2024 01:11:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/796684#M97273</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-08T01:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: How this JSL conversion to base 36 is done in python.</title>
      <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/797007#M97287</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;I have two questions for the experts:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;1. How to concatenate two JMP tables in python?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;2, how can the following python be modified to python asyncio asynchronous execution form?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;Thanks Experts!&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import jmputils
import jmp
from datetime import datetime, timedelta

today = datetime.today()
dates = []
for i in range(200):
    dates.append((today - timedelta(days=i)).strftime('%Y%m%d'))
j = 0
for date in dates:
    #print(date)
    j += 1
    jmp.run_jsl('''
b=Python Get(date);
d1=New Table("o",Add Rows(1),New Column("date",Set Values({b})));
Python Send(d1)
    ''')    
    #print(d1)
    jmp.run_jsl('''
j=Python Get(j);
//b=Python Get(d1);
if(j==1,d2=d1;d2&amp;lt;&amp;lt;setName("test");,current data table(d2);d2&amp;lt;&amp;lt;Concatenate(Data Table(d1),Append to first table);Close(d1,nosave));
    ''')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I still don't have an answer.&lt;/SPAN&gt;&lt;SPAN class=""&gt;Looking forward to expert help.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 01:50:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/797007#M97287</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-09T01:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: How this JSL conversion to base 36 is done in python.</title>
      <link>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/797154#M97298</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;I asked ChatGPT several times, and python's asyncio framework is written like this&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;But the execution is always unsuccessful.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Ask for expert help in your community.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import asyncio
import concurrent.futures
import jmp

# Define a global variable kk
kk = 1

# Create an asynchronous function to run the JSL script
async def run_jsl_script():
    global kk
    loop = asyncio.get_event_loop()
    
    # Simplified JSL script
    jsl_script = f'''
    Print("Value of kk: {kk}");
    b = Python Get({kk});
    Print("Value of b: ", b);
    d1 = New Table("o", Add Rows(1), New Column("date", Set Values({{b}})));
    if (b == 1, 
        d2 = d1;
        d2 &amp;lt;&amp;lt; Set Name("Name 2");
        Print("Table d1 copied to d2 with new name.");
    ,
        current data table(d2);
        d2 &amp;lt;&amp;lt; Concatenate(Data Table(d1), Append to first table);
        Close(d1, nosave);
    );
    Python Send(d1);
    '''
    
    # Print the JSL script content for debugging
    print("JSL script to be executed:")
    print(jsl_script)
    
    try:
        # Use a thread pool to run the synchronous JSL script
        with concurrent.futures.ThreadPoolExecutor() as pool:
            # Call jmp.run_jsl function
            await loop.run_in_executor(pool, lambda: jmp.run_jsl(jsl_script))
    except Exception as e:
        print(f"Error occurred: {e}")
    
    # Update the kk variable
    kk += 1
    print(f"Current value of kk: {kk}")

# Main asynchronous function
async def main():
    # Example of running the JSL script multiple times
    for _ in range(3):  # For example, run three times
        await run_jsl_script()

    print("All JSL scripts executed.")

# Run the main function
if __name__ == "__main__":
    asyncio.run(main())&lt;/CODE&gt;&lt;/PRE&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 12:56:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-this-JSL-conversion-to-base-36-is-done-in-python/m-p/797154#M97298</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-09T12:56:32Z</dc:date>
    </item>
  </channel>
</rss>

