While running a python script in IDLE that asks for arguments, no prompt appears that asks for parameters. Same script in PythonWin runs fine. A simple example:
import sys import arcpy
x = sys.argv[1] y = sys.argv[2]
print x y
PythonWin brings up a box to enter arguments (enter two numbers) and run script and it prints the numbers. IDLE doesn't bring up a box or any prompt . . . . spins it's wheels for a few seconds then bombs saying no value entered. Is there a setting I am missing when running scripts in IDLE that prompt for user input? Same results if I use GetParameterAsText instead of sys.argv . . . .
Every IDE is different, but as an example, when you click to run a script in PythonWin, there is a section to add parameters. You can just specify your parameters here. Please see the attached screenshot as an example.
Thanks Lucas . . . I know I probably wasn't clear . . . Yes, I get same thing in PythonWin as you, no problem. How would I get such a prompt to enter arguments when I run the same script in IDLE though? When run in IDLE, it processes for a few seconds, then crashes and says no values - never had a prompt like PythonWin though to enter values. Do you know how to do or configure that in IDLE?
As far as I know there is no way for parameters in IDLE. You can run it from CMD window if you like. Since you cannot stop for debug you do not really important. I just replace the line "x = sys.argv[1]" with "x = SomeValue" when I want to run from IDLE
Every IDE is different, but as an example, when you click to run a script in PythonWin, there is a section to add parameters. You can just specify your parameters here. Please see the attached screenshot as an example.