<?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 Python Script editor in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-Python-Script-editor/m-p/891733#M105287</link>
    <description>&lt;P&gt;Scripting Index and Scripting Guide do have examples for this&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1754020831296.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/79409iA53D0A8B7D6ADABC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1754020831296.png" alt="jthi_1-1754020831296.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import jmp

jmp.open(jmp.SAMPLE_DATA + 'Big Class.jmp')
print(jmp.current())
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://origin-www.jmp.com/support/help/en/18.2/#page/jmp/using-operators-to-test-jmp-objects.shtml#" target="_blank" rel="noopener"&gt;Scripting Guide &amp;gt; Python &amp;gt; Working with JMP Data Tables &amp;gt; Using Operators to Test JMP Objects&lt;/A&gt;&amp;nbsp;(not the best example)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://origin-www.jmp.com/support/help/en/18.2/#page/jmp/jmp-package-functions.shtml#" target="_blank" rel="noopener"&gt;Scripting Guide &amp;gt; Python &amp;gt; Python Syntax Reference &amp;gt; jmp Package Functions&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Aug 2025 04:02:14 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-08-01T04:02:14Z</dc:date>
    <item>
      <title>JMP Python Script editor</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Python-Script-editor/m-p/891703#M105284</link>
      <description>&lt;P&gt;In the JMP python script editor, what is the code, after 'import jmp' that points to the open jmp table I want to read and write to with code? &amp;nbsp;I thought it would be simple and 'native' to JMP python. &amp;nbsp;I get 'no open table'&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 01:34:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Python-Script-editor/m-p/891703#M105284</guid>
      <dc:creator>aadecarlojr</dc:creator>
      <dc:date>2025-08-01T01:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Python Script editor</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Python-Script-editor/m-p/891733#M105287</link>
      <description>&lt;P&gt;Scripting Index and Scripting Guide do have examples for this&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1754020831296.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/79409iA53D0A8B7D6ADABC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1754020831296.png" alt="jthi_1-1754020831296.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import jmp

jmp.open(jmp.SAMPLE_DATA + 'Big Class.jmp')
print(jmp.current())
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://origin-www.jmp.com/support/help/en/18.2/#page/jmp/using-operators-to-test-jmp-objects.shtml#" target="_blank" rel="noopener"&gt;Scripting Guide &amp;gt; Python &amp;gt; Working with JMP Data Tables &amp;gt; Using Operators to Test JMP Objects&lt;/A&gt;&amp;nbsp;(not the best example)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://origin-www.jmp.com/support/help/en/18.2/#page/jmp/jmp-package-functions.shtml#" target="_blank" rel="noopener"&gt;Scripting Guide &amp;gt; Python &amp;gt; Python Syntax Reference &amp;gt; jmp Package Functions&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 04:02:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Python-Script-editor/m-p/891733#M105287</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-08-01T04:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Python Script editor</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Python-Script-editor/m-p/892229#M105322</link>
      <description>&lt;P&gt;The&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;import jmp&lt;/STRONG&gt;&lt;/EM&gt; package is the interface layer between the Python scripts and JMP internals. &amp;nbsp;An entire&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Python&lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;category has been added to the Scripting Index. &amp;nbsp;This section provides documentation and examples for interacting with JMP from Python. &amp;nbsp;The Python Integration is a continuing work in progress. &amp;nbsp;JMP 18 focuses primarily on the minimum necessary set of capabilities. &amp;nbsp;Package installation, Data Table interaction, transfer of data between JMP and Python. &amp;nbsp;JMP 19 expands on this with additional data table column support, better interaction with data frames, additional JMP -&amp;gt; Python, Python -&amp;gt; JMP data type support, and other new capabilities...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2025 17:10:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Python-Script-editor/m-p/892229#M105322</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2025-08-04T17:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Python Script editor</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Python-Script-editor/m-p/892487#M105348</link>
      <description>&lt;P&gt;Thanks to those who responded to help. &amp;nbsp;I did get it to 'open' the table I wanted. &amp;nbsp;For those who might be able to use what I came up with to open the jmp table, then export column entries to a third-party web site to extract data from the pages related to each column entry, here is a general form of the Python code I worked out. &amp;nbsp;I am still working on getting the output to load directly back into the jmp table rather than extracting it from the log, although such log extraction does allow for editing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;import jmp&lt;BR /&gt;from selenium import webdriver&lt;BR /&gt;from selenium.webdriver.common.by import By&lt;BR /&gt;from selenium.webdriver.chrome.options import Options&lt;BR /&gt;from selenium.webdriver.support.ui import WebDriverWait&lt;BR /&gt;from selenium.webdriver.support import expected_conditions as EC&lt;BR /&gt;from selenium.common.exceptions import TimeoutException&lt;/P&gt;
&lt;P&gt;# Set up Selenium WebDriver&lt;BR /&gt;options = Options()&lt;BR /&gt;options.headless = False # Runs Safari in visible mode for debugging&lt;/P&gt;
&lt;P&gt;# Initialize the WebDriver (Safari)&lt;BR /&gt;driver = webdriver.Safari()&lt;/P&gt;
&lt;P&gt;# Path to the JMP file (adjusted to the path you provided)&lt;BR /&gt;file_path = "/YOUR JMP PATH.jmp"&lt;/P&gt;
&lt;P&gt;# Open the specific table by file path&lt;BR /&gt;dt = jmp.open(file_path) # Open the table directly from the file&lt;/P&gt;
&lt;P&gt;# Access the 'YOUR_COLUMN' column from the open table&lt;BR /&gt;YOUR COLUMN_column = dt["YOUR COLUMN"] # Correct syntax for accessing a column&lt;/P&gt;
&lt;P&gt;# Initialize a list to store the results (YOUR NEW COLUMNS&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;results = []&lt;/P&gt;
&lt;P&gt;# Function to extract YOUR DATA:&lt;BR /&gt;url = f'&lt;A href="https://www.YOUR" target="_blank"&gt;https://www.YOUR&lt;/A&gt; WEB PAGE TO EXTRACT FROM'&lt;/P&gt;
&lt;P&gt;try:&lt;BR /&gt;# Open the URL&lt;BR /&gt;driver.get(url)&lt;BR /&gt;&lt;BR /&gt;# Set a short timeout (e.g., 5 seconds) to wait for the page to load&lt;BR /&gt;WebDriverWait(driver, 5).until(EC.presence_of_element_located((By.XPATH, "//a[contains(@href, 'YOUR_KEY')]")))&lt;/P&gt;
&lt;P&gt;# Adjust XPath to grab the correct link (e.g., get the first match)&lt;BR /&gt;YOUR_tag = driver.find_element(By.XPATH, "//a[contains(@href, 'YOUR_KEY') and not(contains(@href, 'access'))]") # Exclude 'access' related links&lt;BR /&gt;YOUR_KEY = YOUR_TAG.text.strip() # Extract the text of YOUR KEY&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;return YOUR_OUTPUT&lt;BR /&gt;except TimeoutException:&lt;BR /&gt;print(f"Timeout error for YOUR_COLUMN {YOUR_COLUMN}: URL did not load within the specified time.")&lt;BR /&gt;return None, None # If the URL doesn't load, return None YOUR TAGS&lt;BR /&gt;except Exception as e:&lt;BR /&gt;print(f"Error extracting YOUR TAGS for YOUR_COLUMN {YOUR_COLUMN}: {e}")&lt;BR /&gt;return None, None&lt;/P&gt;
&lt;P&gt;# Iterate over each row&lt;BR /&gt;YOUR_OUTPUT = get_YOUR_OUTPUT(YOUR_COLUMN)&lt;BR /&gt;results.append((YOUR_OUTPUT)) # Store the result as a tuple&lt;/P&gt;
&lt;P&gt;# Print the results&lt;BR /&gt;&lt;BR /&gt;print(f"YOUR_COLUMN: {YOUR_COLUMN} -&amp;gt; YOUR_TAG: {YOUR_NEW_DATA})&lt;/P&gt;
&lt;P&gt;# Close the WebDriver after processing all the entries&lt;BR /&gt;driver.quit()&lt;/P&gt;</description>
      <pubDate>Tue, 05 Aug 2025 14:29:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Python-Script-editor/m-p/892487#M105348</guid>
      <dc:creator>aadecarlojr</dc:creator>
      <dc:date>2025-08-05T14:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Python Script editor</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Python-Script-editor/m-p/893971#M105490</link>
      <description>&lt;P&gt;You have the results, there are multiple ways to put that directly into a data table. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To set a specific cell value in a table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;dt['col_name'][ row# ] = value&lt;/PRE&gt;
&lt;P&gt;Remember in Python indexing is zero-based, where in JSL it is one-based. So the first row from Python is dt['col'][0]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or set an entire column at a time from a list&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;dt['col'] = results&lt;/PRE&gt;
&lt;P&gt;With the above the length of results must match the data tables number of rows, &amp;nbsp;&lt;STRONG&gt;&lt;EM&gt; len(results) == dt.nrows&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Also,&amp;nbsp;&amp;nbsp;dt's data type must match that of the elements of the list, which must all be of the same type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;New data tables can be created from Python, as can new columns and rows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2025 18:36:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Python-Script-editor/m-p/893971#M105490</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2025-08-12T18:36:31Z</dc:date>
    </item>
  </channel>
</rss>

