1

In python only, I use S = float(raw_input( 'Insert the value: ') when I want allow to user insert a value then is used in that script.

When I try to use the same on a python script that I've already implement as script tool on arcgis, it seems no possible because give me an error like this:

Runtime error Traceback (most recent call last): File "", line 769, in EOFError: EOF when reading a line

So I infer that the problem is arcpy don't recognize the function "raw_input" or python window doesn't allow that user insert a value..

Can anyone help me to replace python's function raw_input ?

1

1 Answer 1

3

There is a Help page entitled Understanding script tool parameters that explains how to do this.

You configure the Parameters on the tool dialog and then get them within your script using either arcpy.GetParameter() or arcpy.GetParameterAsText().

4
  • I believe it was not what I was asking , I have created the script tool , my question is to create a code with an identical part of the " raw_input ", used in python, that ask the user to enter a value, because when I use raw_input program gives an error
    – S.Rai
    Commented Apr 26, 2016 at 10:43
  • It seemed to me that you were asking how to "build custom script tools with input parameters (via arcpy.GetParameterAsText());".
    – PolyGeo
    Commented Apr 26, 2016 at 10:59
  • I think that 's not what I need.. I just need to request user that insert a value as I can do with python using raw_input and I can't do with arcpy.. Do you understand? @PolyGeo
    – S.Rai
    Commented Apr 26, 2016 at 11:41
  • Perhaps try editing your question because that seems to be saying something different to your comments. It is your question that gets answered.
    – PolyGeo
    Commented Apr 26, 2016 at 11:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.