<?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 How to change the path for saving / opening file in JMP 19 / Python script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-change-the-path-for-saving-opening-file-in-JMP-19-Python/m-p/919048#M107833</link>
    <description>&lt;P&gt;Dear,&lt;/P&gt;
&lt;P&gt;I run the following script in JMP19 and now in the file the script gets stuck at the bold line below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The table &lt;STRONG&gt;results.json&lt;/STRONG&gt; is on my desk-top. I tried to copy the file and path to a different storage location.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It still gets stuck.&lt;/P&gt;
&lt;P&gt;In JMP&amp;nbsp;19 the script was working as it is...&lt;/P&gt;
&lt;P&gt;Do you now how to change it?&lt;/P&gt;
&lt;P&gt;I think that I need to tell the script to save the file into the Python path in the JMP19 folder on my, computer,....maybe?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;with open("results.json", "w+") ......&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Best wishes,&lt;BR /&gt;Ole&lt;/P&gt;</description>
    <pubDate>Fri, 12 Dec 2025 12:52:46 GMT</pubDate>
    <dc:creator>Ole_Luehn</dc:creator>
    <dc:date>2025-12-12T12:52:46Z</dc:date>
    <item>
      <title>How to change the path for saving / opening file in JMP 19 / Python script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-change-the-path-for-saving-opening-file-in-JMP-19-Python/m-p/919048#M107833</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;
&lt;P&gt;I run the following script in JMP19 and now in the file the script gets stuck at the bold line below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The table &lt;STRONG&gt;results.json&lt;/STRONG&gt; is on my desk-top. I tried to copy the file and path to a different storage location.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It still gets stuck.&lt;/P&gt;
&lt;P&gt;In JMP&amp;nbsp;19 the script was working as it is...&lt;/P&gt;
&lt;P&gt;Do you now how to change it?&lt;/P&gt;
&lt;P&gt;I think that I need to tell the script to save the file into the Python path in the JMP19 folder on my, computer,....maybe?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;with open("results.json", "w+") ......&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Best wishes,&lt;BR /&gt;Ole&lt;/P&gt;</description>
      <pubDate>Fri, 12 Dec 2025 12:52:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-change-the-path-for-saving-opening-file-in-JMP-19-Python/m-p/919048#M107833</guid>
      <dc:creator>Ole_Luehn</dc:creator>
      <dc:date>2025-12-12T12:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the path for saving / opening file in JMP 19 / Python script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-change-the-path-for-saving-opening-file-in-JMP-19-Python/m-p/919099#M107838</link>
      <description>&lt;P&gt;Sorry. I meant in JMP 18 it was working...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Dec 2025 14:43:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-change-the-path-for-saving-opening-file-in-JMP-19-Python/m-p/919099#M107838</guid>
      <dc:creator>Ole_Luehn</dc:creator>
      <dc:date>2025-12-12T14:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the path for saving / opening file in JMP 19 / Python script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-change-the-path-for-saving-opening-file-in-JMP-19-Python/m-p/919100#M107839</link>
      <description>&lt;P&gt;A little clarification please. You indicate the script now gets stuck in JMP 19, further down you indicate, in JMP 19 the script was working as is...? &amp;nbsp; I'm assuming you mean it hangs in JMP 19 but was working in 18? &amp;nbsp;Always helpful to have the full version numbers since we do make security and bug fix releases such as 19.0.1.&lt;/P&gt;
&lt;P&gt;What is supposed to happen, is that the file would be saved to the same directory as the JSL script. &amp;nbsp;Running the JSL script would set the current working directory to the location of the jsl script, and without additional path components on the Python open() would default to saving in the same directory as the JSL. &amp;nbsp;If your JSL isn't pulling further JSL files as includes, you could even use Python commands to change the current working directory.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On the Python side of things you can easily specify the full path to the file, including use of special directories. &amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import jmp
import os

...
&lt;BR /&gt;# using os.path.join() makes path portable on macOS and Windows 
on_desktop = os.path.join( jmp.DESKTOP, 'results.json')
with open( on_desktop, 'w+' as f:
    f.write( str(response.primary_results[0]))

..&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Dec 2025 14:52:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-change-the-path-for-saving-opening-file-in-JMP-19-Python/m-p/919100#M107839</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2025-12-12T14:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the path for saving / opening file in JMP 19 / Python script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-change-the-path-for-saving-opening-file-in-JMP-19-Python/m-p/919508#M107863</link>
      <description>&lt;P&gt;Dear Paul.&lt;BR /&gt;Yes, thank you, your assumptions were right. indeed I had the JMP 19.0.1 version and needed to change the path for the saving of the files.&amp;nbsp;&lt;BR /&gt;That helped. In my "old" 18 version, that was not the case (not needed).&lt;BR /&gt;Thank you!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Dec 2025 12:22:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-change-the-path-for-saving-opening-file-in-JMP-19-Python/m-p/919508#M107863</guid>
      <dc:creator>Ole_Luehn</dc:creator>
      <dc:date>2025-12-15T12:22:13Z</dc:date>
    </item>
  </channel>
</rss>

