<?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: raw_input in Select_analysis? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/raw-input-in-select-analysis/m-p/537459#M42033</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.workspace=r"I:\GIS\Test.mdb"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EL1=raw_input('Enter name of elementary school')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outFeatureClass='I:\GIS\Output.mdb\school_'+EL1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;whereString='[NAME]="'+EL1+'"'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Select_analysis('SchoolDistrictsElementary',outFeatureClass,whereString)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your original code, the variable EL1 was read as a string instead of it's value in your WHERE clause. I haven't ran the code, but this should work. Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edited due to misreading OP&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Mar 2011 17:21:35 GMT</pubDate>
    <dc:creator>StevenArebalo</dc:creator>
    <dc:date>2011-03-30T17:21:35Z</dc:date>
    <item>
      <title>raw_input in Select_analysis?</title>
      <link>https://community.esri.com/t5/python-questions/raw-input-in-select-analysis/m-p/537458#M42032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm working on a simple suitability analysis project for my GIS programming class wherein raw_inputs iare used to define part of the where_clause in Select_analysis. Here is what I have so far:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.workspace=r"I:\GIS\Test.mdb"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EL1=raw_input('Enter name of elementary school')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Select_analysis('SchoolDistrictsElementary',r'I:\GIS\Output.mdb\school'+'_'+'EL1','[NAME]=EL1')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I run the script, I get the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;General function failure [SchoolDistrictsElementary]&lt;BR /&gt;Too few parameters. Expected 1.&lt;BR /&gt;Failed to execute (Select).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried everything I could think of, although my Python-fu is pretty weak. Nonetheless, this seems like on of those cases when the answer is right under my nose. Any thoughts on how to fix this issue? Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 17:03:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raw-input-in-select-analysis/m-p/537458#M42032</guid>
      <dc:creator>RyanCooper</dc:creator>
      <dc:date>2011-03-30T17:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: raw_input in Select_analysis?</title>
      <link>https://community.esri.com/t5/python-questions/raw-input-in-select-analysis/m-p/537459#M42033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.workspace=r"I:\GIS\Test.mdb"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EL1=raw_input('Enter name of elementary school')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outFeatureClass='I:\GIS\Output.mdb\school_'+EL1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;whereString='[NAME]="'+EL1+'"'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Select_analysis('SchoolDistrictsElementary',outFeatureClass,whereString)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your original code, the variable EL1 was read as a string instead of it's value in your WHERE clause. I haven't ran the code, but this should work. Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edited due to misreading OP&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 17:21:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raw-input-in-select-analysis/m-p/537459#M42033</guid>
      <dc:creator>StevenArebalo</dc:creator>
      <dc:date>2011-03-30T17:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: raw_input in Select_analysis?</title>
      <link>https://community.esri.com/t5/python-questions/raw-input-in-select-analysis/m-p/537460#M42034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your reply. I couldn't quite get that to work. It would return an error that there was a missing operator for:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;whereString='I:\GIS\Output.mdb\school_'+EL1+',[NAME]="'+EL1+'"'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, I adjusted my project a little bit so it's not so important that I have this element to it. Nonetheless, thank you again for your help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 14:58:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raw-input-in-select-analysis/m-p/537460#M42034</guid>
      <dc:creator>RyanCooper</dc:creator>
      <dc:date>2011-03-31T14:58:57Z</dc:date>
    </item>
  </channel>
</rss>

