<?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: Python Output Parameter as String in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/python-output-parameter-as-string/m-p/429283#M14429</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Duncan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the reply but I'm not seeing how the AddFieldDelimiters method will help me.&amp;nbsp; I'm not trying to format a field; I'm trying to format some text that I'm getting from a textbox from my endusers (arcServer).&amp;nbsp; Not sure if I'm missing something...can I use this method a different way?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;J&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Jan 2011 22:18:19 GMT</pubDate>
    <dc:creator>JMcNeil</dc:creator>
    <dc:date>2011-01-24T22:18:19Z</dc:date>
    <item>
      <title>Python Output Parameter as String</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-output-parameter-as-string/m-p/429281#M14427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm writing this in 9.3.1.&amp;nbsp; Basically I'm taking in a string and trying to format it for a tool "Select Layer by Attribute".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to write a python script to take in a string express, then I'm formatting it and then I'm sending out as a string but I'm having trouble with the output parameter.&amp;nbsp; Can you tell me what is wrong with my last line and what I need to change.&amp;nbsp; The line that is giving me trouble is &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.SetParameterAsText(output)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the error is stating &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Running script StringManipulator...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;type 'exceptions.AttributeError'&amp;gt;: Object: Error in parsing arguments for SetParameterAsText&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (StringManipulator).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's my short script&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import sys, string, arcgisscripting
gp = arcgisscripting.create(9.3)
userStr = gp.GetParameterAsText(0)
# userStr = sys.argv(0)
strList = userStr.split(" or ")
output = " or ".join(["\"APN\" = \'%s\'" % (item) for item in strList])
gp.SetParameterAsText(output)
#print output

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want more background I'm why I'm doing this check out this post.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/210...ed=1#post69372" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/210...ed=1#post69372&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;J&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:18:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-output-parameter-as-string/m-p/429281#M14427</guid>
      <dc:creator>JMcNeil</dc:creator>
      <dc:date>2021-12-11T19:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Python Output Parameter as String</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-output-parameter-as-string/m-p/429282#M14428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;J,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you aware of the &lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=982&amp;amp;pid=980&amp;amp;topicname=AddFieldDelimiters_method"&gt;AddFieldDelimiters&lt;/A&gt;&lt;SPAN&gt; method on the Geoprocessor?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jan 2011 13:15:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-output-parameter-as-string/m-p/429282#M14428</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2011-01-24T13:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Python Output Parameter as String</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-output-parameter-as-string/m-p/429283#M14429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Duncan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the reply but I'm not seeing how the AddFieldDelimiters method will help me.&amp;nbsp; I'm not trying to format a field; I'm trying to format some text that I'm getting from a textbox from my endusers (arcServer).&amp;nbsp; Not sure if I'm missing something...can I use this method a different way?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;J&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jan 2011 22:18:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-output-parameter-as-string/m-p/429283#M14429</guid>
      <dc:creator>JMcNeil</dc:creator>
      <dc:date>2011-01-24T22:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python Output Parameter as String</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-output-parameter-as-string/m-p/429284#M14430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;J,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking at the &lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=SetParameterAsText_method"&gt;Help&lt;/A&gt;&lt;SPAN&gt; it says that you need to provide an index position for you output parameter which you are not supplying as shown in your sample code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 09:05:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-output-parameter-as-string/m-p/429284#M14430</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2011-01-25T09:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Python Output Parameter as String</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-output-parameter-as-string/m-p/429285#M14431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Duncan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks! Before I was setting the parameter but that example showed me how to set like&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.SetParameterAsText(1, output)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;J&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jan 2011 20:19:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-output-parameter-as-string/m-p/429285#M14431</guid>
      <dc:creator>JMcNeil</dc:creator>
      <dc:date>2011-01-26T20:19:20Z</dc:date>
    </item>
  </channel>
</rss>

