<?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: concatenating a variable into a python string in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/concatenating-a-variable-into-a-python-string/m-p/842776#M101655</link>
    <description>&lt;P&gt;Maybe something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
fox = "python";
Python Init();
Python Submit( evalinsert("\[
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;</description>
    <pubDate>Wed, 19 Feb 2025 13:55:38 GMT</pubDate>
    <dc:creator>pmroz</dc:creator>
    <dc:date>2025-02-19T13:55:38Z</dc:date>
    <item>
      <title>concatenating a variable into a python string</title>
      <link>https://community.jmp.com/t5/Discussions/concatenating-a-variable-into-a-python-string/m-p/842497#M101630</link>
      <description>&lt;P&gt;Its been a while since I've really messed with this stuff, but having some issues with the Python Submit function.&amp;nbsp; &amp;nbsp;Take the following code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I wanted to make the word "fox" a variable I would have thought it was just a matter of concatenating a variable into the string, but for whatever reason I can't seem to break that string?&amp;nbsp; Maybe it's because it's a list of strings?&amp;nbsp; &amp;nbsp;I feel like this is an obvious one but for whatever reason I'm missing it.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 21:56:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/concatenating-a-variable-into-a-python-string/m-p/842497#M101630</guid>
      <dc:creator>emorris1000</dc:creator>
      <dc:date>2025-02-18T21:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating a variable into a python string</title>
      <link>https://community.jmp.com/t5/Discussions/concatenating-a-variable-into-a-python-string/m-p/842586#M101634</link>
      <description>&lt;P&gt;I assume you are not using JMP18 (but it shouldn't matter). I'm not sure what issue you are having? You are sending one string and one numeric value to Python and then printing them in JMP which should work fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;JMP18&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1739941643901.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/73100i6C51A185D61C433A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1739941643901.png" alt="jthi_0-1739941643901.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 05:07:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/concatenating-a-variable-into-a-python-string/m-p/842586#M101634</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-02-19T05:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating a variable into a python string</title>
      <link>https://community.jmp.com/t5/Discussions/concatenating-a-variable-into-a-python-string/m-p/842776#M101655</link>
      <description>&lt;P&gt;Maybe something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
fox = "python";
Python Init();
Python Submit( evalinsert("\[
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;</description>
      <pubDate>Wed, 19 Feb 2025 13:55:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/concatenating-a-variable-into-a-python-string/m-p/842776#M101655</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2025-02-19T13:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating a variable into a python string</title>
      <link>https://community.jmp.com/t5/Discussions/concatenating-a-variable-into-a-python-string/m-p/842962#M101665</link>
      <description>&lt;P&gt;That appears to do it.&amp;nbsp; Any idea why it uses the carrat for that as opposed to just escaping with quotes?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 21:03:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/concatenating-a-variable-into-a-python-string/m-p/842962#M101665</guid>
      <dc:creator>emorris1000</dc:creator>
      <dc:date>2025-02-19T21:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating a variable into a python string</title>
      <link>https://community.jmp.com/t5/Discussions/concatenating-a-variable-into-a-python-string/m-p/842974#M101666</link>
      <description>&lt;P&gt;EvalInsert is a JMP JSL function that uses ^ as the default delimiter for the insert.&amp;nbsp; Here is the JMP Scripting Index entry for the description of the function&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1740000175825.png" style="width: 814px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/73178i8B63B3558486BF55/image-dimensions/814x139?v=v2" width="814" height="139" role="button" title="txnelson_0-1740000175825.png" alt="txnelson_0-1740000175825.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The substitution of Fox is performed in JMP before being passed to Python&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 21:24:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/concatenating-a-variable-into-a-python-string/m-p/842974#M101666</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-02-19T21:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating a variable into a python string</title>
      <link>https://community.jmp.com/t5/Discussions/concatenating-a-variable-into-a-python-string/m-p/842985#M101668</link>
      <description>&lt;P&gt;You could also do it this way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
fox = "python";
Python Init();
Python Submit( evalinsert("
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;evalinsert offers a cleaner method, IMHO.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 21:30:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/concatenating-a-variable-into-a-python-string/m-p/842985#M101668</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2025-02-19T21:30:47Z</dc:date>
    </item>
  </channel>
</rss>

