<?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 Can I control which strings get replaced by g_ESRI_variable_* in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/can-i-control-which-strings-get-replaced-by-g-esri/m-p/567781#M21904</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a python script tool that I publish as a geoprocessing service.&amp;nbsp; There are several places in my code where I want to split the longName of a layer into its components using the python split() method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; prefix = lyr.longName.split("\\")[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when the script tool is published, the code transformation that ArcGIS Server applies detects the "\\" string as a path and assigns it to an g_ESRI_variable that causes the code to fail.&amp;nbsp; Here is code that exists in ArcGIS server extracted/ folder&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; g_ESRI_variable_2 = os.path.join(arcpy.env.packageWorkspace, u'arctoolbox')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; prefix = lyr.longName.split(g_ESRI_variable_2)[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to indicate that a particular string literal should be let alone? Or perhaps an alternative way of performing the split that will not trigger the path replacement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Jul 2014 12:50:54 GMT</pubDate>
    <dc:creator>LucasScharenbroich</dc:creator>
    <dc:date>2014-07-15T12:50:54Z</dc:date>
    <item>
      <title>Can I control which strings get replaced by g_ESRI_variable_*</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/can-i-control-which-strings-get-replaced-by-g-esri/m-p/567781#M21904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a python script tool that I publish as a geoprocessing service.&amp;nbsp; There are several places in my code where I want to split the longName of a layer into its components using the python split() method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; prefix = lyr.longName.split("\\")[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when the script tool is published, the code transformation that ArcGIS Server applies detects the "\\" string as a path and assigns it to an g_ESRI_variable that causes the code to fail.&amp;nbsp; Here is code that exists in ArcGIS server extracted/ folder&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; g_ESRI_variable_2 = os.path.join(arcpy.env.packageWorkspace, u'arctoolbox')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; prefix = lyr.longName.split(g_ESRI_variable_2)[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to indicate that a particular string literal should be let alone? Or perhaps an alternative way of performing the split that will not trigger the path replacement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jul 2014 12:50:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/can-i-control-which-strings-get-replaced-by-g-esri/m-p/567781#M21904</guid>
      <dc:creator>LucasScharenbroich</dc:creator>
      <dc:date>2014-07-15T12:50:54Z</dc:date>
    </item>
  </channel>
</rss>

