<?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: ModelBuilder VB to Python Conversion in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/modelbuilder-vb-to-python-conversion/m-p/1227008#M65973</link>
    <description>&lt;P&gt;Hello, thank you much!&lt;/P&gt;</description>
    <pubDate>Mon, 31 Oct 2022 12:41:45 GMT</pubDate>
    <dc:creator>CTalbot</dc:creator>
    <dc:date>2022-10-31T12:41:45Z</dc:date>
    <item>
      <title>ModelBuilder VB to Python Conversion</title>
      <link>https://community.esri.com/t5/python-questions/modelbuilder-vb-to-python-conversion/m-p/1226784#M65967</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm writing for some assistance in troubleshooting converting an old Model from VB script to Python.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The specific area giving me trouble is a Calculate Field Expression&amp;nbsp;&lt;/P&gt;&lt;P&gt;here's what I started with:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=[AREA_CODE] &amp;amp; Replace ([BIDDER_PERCENTAGES_TABLE_SELECT_BLOCK_NUMBER], " ", "")&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;this gave error00539&amp;nbsp;'Replace' is not defined&lt;/P&gt;&lt;P&gt;Here's a couple things I attempted:&lt;/P&gt;&lt;P&gt;!AREA_CODE! &amp;amp; Replace (!BIDDER_PERCENTAGES_TABLE_SELECT_BLOCK_NUMBER!, " ", "")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;^same error code&lt;/P&gt;&lt;P&gt;!AREA_CODE! + replace (!BIDDER_PERCENTAGES_TABLE_SELECT_BLOCK_NUMBER!, " ", "")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;^same error code&lt;/P&gt;&lt;P&gt;!AREA_CODE! + (!BIDDER_PERCENTAGES_TABLE_SELECT_BLOCK_NUMBER!, " ", "")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;^error 00539-TypeError: can only concatenate str (not "tuple") to str&lt;/P&gt;&lt;P&gt;!AREA_CODE! + tuple(!BIDDER_PERCENTAGES_TABLE_SELECT_BLOCK_NUMBER!, " ", "")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;^error 00539-TypeError: tuple expected at most 1 arguments, got 3&lt;/P&gt;&lt;P&gt;!AREA_CODE! + [tuple(!BIDDER_PERCENTAGES_TABLE_SELECT_BLOCK_NUMBER!, " ", "")]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;^error 00539-Syntax error: invalid syntax&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm at a bit of a loss as to what to try next&lt;/P&gt;&lt;P&gt;please let me know what you think&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Christopher&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/454840"&gt;@arcgis_python&lt;/a&gt;&amp;nbsp;&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>Fri, 28 Oct 2022 20:38:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/modelbuilder-vb-to-python-conversion/m-p/1226784#M65967</guid>
      <dc:creator>CTalbot</dc:creator>
      <dc:date>2022-10-28T20:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder VB to Python Conversion</title>
      <link>https://community.esri.com/t5/python-questions/modelbuilder-vb-to-python-conversion/m-p/1226812#M65969</link>
      <description>&lt;P&gt;I am thinking the REPLACE part is doing nothing but maybe convert a numeric field to a string The str() will pretty much turn anything into a string, so this seems like it would be safe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;str(!AREA_CODE!) + str(!BIDDER_PERCENTAGES_TABLE_SELECT_BLOCK_NUMBER!)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 22:01:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/modelbuilder-vb-to-python-conversion/m-p/1226812#M65969</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2022-10-28T22:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder VB to Python Conversion</title>
      <link>https://community.esri.com/t5/python-questions/modelbuilder-vb-to-python-conversion/m-p/1226827#M65970</link>
      <description>&lt;P&gt;Assuming that you want to concatenate the two fields and remove spaces&amp;nbsp; in the longer field name.&amp;nbsp; "str"ing both fields in case a number to text conversion is necessary.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;str(!AREA_CODE!) + str(!BIDDER_PERCENTAGES_TABLE_SELECT_BLOCK_NUMBER!).replace(" ", "")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 23:01:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/modelbuilder-vb-to-python-conversion/m-p/1226827#M65970</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-10-28T23:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder VB to Python Conversion</title>
      <link>https://community.esri.com/t5/python-questions/modelbuilder-vb-to-python-conversion/m-p/1227008#M65973</link>
      <description>&lt;P&gt;Hello, thank you much!&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 12:41:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/modelbuilder-vb-to-python-conversion/m-p/1227008#M65973</guid>
      <dc:creator>CTalbot</dc:creator>
      <dc:date>2022-10-31T12:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder VB to Python Conversion</title>
      <link>https://community.esri.com/t5/python-questions/modelbuilder-vb-to-python-conversion/m-p/1227009#M65974</link>
      <description>&lt;P&gt;Hello, Thank You much!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 12:42:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/modelbuilder-vb-to-python-conversion/m-p/1227009#M65974</guid>
      <dc:creator>CTalbot</dc:creator>
      <dc:date>2022-10-31T12:42:53Z</dc:date>
    </item>
  </channel>
</rss>

