<?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: Variable passing problem in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/variable-passing-problem/m-p/336056#M26335</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;and you tried?&lt;/P&gt;&lt;P&gt;"!PCL_LN_CD!.replace(\'a\', \'b\')"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Nov 2014 05:33:06 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2014-11-28T05:33:06Z</dc:date>
    <item>
      <title>Variable passing problem</title>
      <link>https://community.esri.com/t5/python-questions/variable-passing-problem/m-p/336055#M26334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dear sir!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote a python function to replace an attribute. But variable "a &amp;amp; b" not passing through CalculateField_management.&lt;/P&gt;&lt;P&gt;Can you give me an advice to correct it. &lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Padmasiri&lt;/P&gt;&lt;P&gt;def foo(s1):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "'{}'".format(s1)&lt;/P&gt;&lt;P&gt;def BoundCal(a,b):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; New_Name = arcpy.AddFieldDelimiters(env.workspace, "PCL_LN_CD")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where1 = New_Name + '=' + foo(str(a))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management("ABC_Lyr", "NEW_SELECTION", where1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management("ABC_Lyr", "PCL_LN_CD", "!PCL_LN_CD!.replace(\"a\", \"b\")" , "PYTHON_9.3" "")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Nov 2014 04:51:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/variable-passing-problem/m-p/336055#M26334</guid>
      <dc:creator>H_A_D_Padmasiri</dc:creator>
      <dc:date>2014-11-28T04:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Variable passing problem</title>
      <link>https://community.esri.com/t5/python-questions/variable-passing-problem/m-p/336056#M26335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;and you tried?&lt;/P&gt;&lt;P&gt;"!PCL_LN_CD!.replace(\'a\', \'b\')"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Nov 2014 05:33:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/variable-passing-problem/m-p/336056#M26335</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-11-28T05:33:06Z</dc:date>
    </item>
  </channel>
</rss>

