<?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 interactive input of values during Python sript processing in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/interactive-input-of-values-during-python-sript/m-p/23161#M1783</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I need create script, where user will be interactively insert values. Script will have these processing steps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) select input file&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) do some calculations&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) type result of calculations to message window&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4) user interactively input value based on results of steps 2 and 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5) calculation continue&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; and script &lt;/SPAN&gt;&lt;STRONG&gt;MUST&lt;/STRONG&gt;&lt;SPAN&gt; be used as tool in ArcMap ToolBox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For selection of input file I use gp.GetParameterAsText() function and it is ok. For input during script processing I try use raw_input function-it is work in command prompt, but when I use it as script added to toolbox, process is crashed and I get this error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;type 'exceptions.EOFError'&amp;gt;: EOF when reading a line&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone advise please ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Example of my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import os, string, arcgisscripting, sys&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp=arcgisscripting.create(9.3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##select input file&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in_file=gp.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##treshold=gp.GetParameterAsText(2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##example of calculation&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.MakeFeatureLayer(in_file, "in_file_lyr")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.SelectLayerByAttribute("in_file_lyr","NEW_SELECTION", "\"shape_area\"&amp;gt;1500")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;count=gp.GetCount_management("in_file_lyr")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##writing results to message window&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.addMessage("Selected "+str(count))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##input treshold&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tresh = raw_input('Please type treshold value: ')##do not work in toolbox, process is crashed in this row&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##writing treshold to message window&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.addMessage("Treshold is "+str(tresh))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##computation continue&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Miroslav&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Oct 2011 16:08:39 GMT</pubDate>
    <dc:creator>MiroslavKopecky</dc:creator>
    <dc:date>2011-10-30T16:08:39Z</dc:date>
    <item>
      <title>interactive input of values during Python sript processing</title>
      <link>https://community.esri.com/t5/python-questions/interactive-input-of-values-during-python-sript/m-p/23161#M1783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I need create script, where user will be interactively insert values. Script will have these processing steps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) select input file&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) do some calculations&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) type result of calculations to message window&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4) user interactively input value based on results of steps 2 and 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5) calculation continue&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; and script &lt;/SPAN&gt;&lt;STRONG&gt;MUST&lt;/STRONG&gt;&lt;SPAN&gt; be used as tool in ArcMap ToolBox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For selection of input file I use gp.GetParameterAsText() function and it is ok. For input during script processing I try use raw_input function-it is work in command prompt, but when I use it as script added to toolbox, process is crashed and I get this error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;type 'exceptions.EOFError'&amp;gt;: EOF when reading a line&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone advise please ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Example of my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import os, string, arcgisscripting, sys&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp=arcgisscripting.create(9.3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##select input file&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in_file=gp.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##treshold=gp.GetParameterAsText(2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##example of calculation&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.MakeFeatureLayer(in_file, "in_file_lyr")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.SelectLayerByAttribute("in_file_lyr","NEW_SELECTION", "\"shape_area\"&amp;gt;1500")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;count=gp.GetCount_management("in_file_lyr")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##writing results to message window&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.addMessage("Selected "+str(count))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##input treshold&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tresh = raw_input('Please type treshold value: ')##do not work in toolbox, process is crashed in this row&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##writing treshold to message window&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.addMessage("Treshold is "+str(tresh))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##computation continue&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Miroslav&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Oct 2011 16:08:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/interactive-input-of-values-during-python-sript/m-p/23161#M1783</guid>
      <dc:creator>MiroslavKopecky</dc:creator>
      <dc:date>2011-10-30T16:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: interactive input of values during Python sript processing</title>
      <link>https://community.esri.com/t5/python-questions/interactive-input-of-values-during-python-sript/m-p/23162#M1784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use a GUI toolkit to create a popup input dialog. Tkinter ships with Python, there are also others, wxPython and pyQT for example.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is some code to generate an input dialog with Tkinter: &lt;/SPAN&gt;&lt;A href="http://effbot.org/tkinterbook/tkinter-dialog-windows.htm"&gt;http://effbot.org/tkinterbook/tkinter-dialog-windows.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 03:04:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/interactive-input-of-values-during-python-sript/m-p/23162#M1784</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2011-10-31T03:04:03Z</dc:date>
    </item>
  </channel>
</rss>

