Skip Python Parameter Window?

966
8
02-01-2012 05:43 AM
JeremyLuymes
New Contributor III
I was just curious if there is a way to get python scripts run out of Arctoolbox to skip the parameter input window for scripts which don't need input parameters.

I have several scripts that run updates based on known layers, so they don't need any inputs or outputs.

Any ideas? (besides going through VB/other programming language)
Tags (2)
0 Kudos
8 Replies
JakeDiebolt
Occasional Contributor III
Couldn't you run them from PythonWin? Or even IDLE?
0 Kudos
BruceNielsen
Occasional Contributor III
Couldn't you run them from PythonWin? Or even IDLE?


Or from the command line shell prompt?
0 Kudos
DanPatterson_Retired
MVP Emeritus
Or just define the defaults in the toolbox, so the user can hit OK
0 Kudos
curtvprice
MVP Esteemed Contributor
I was just curious if there is a way to get python scripts run out of Arctoolbox to skip the parameter input window for scripts which don't need input parameters.

I have several scripts that run updates based on known layers, so they don't need any inputs or outputs.

Any ideas? (besides going through VB/other programming language)


You don't need to supply parameters for the script to run. The .py file should run fine just from a system command prompt if there are no parameters or environments the script requires to run correctly. .py and .pyc files are set up to run in Windows, so you can just crank them up using a command window, windows explorer (double-click) or Task Scheduler.
0 Kudos
JohnBocchino
New Contributor II
But what if the goal was to invoke the script from within arc catalog or ARCMap ?  (Creating a button that I can just click on to run the outside executable).  Outside the arcgis software, double clicking the .py that runs the exe works just fine.  No parameter bx popping up. However, once you try to run the py from inside arcgis, a user is then forced to click ok in the parameter box just to run the outside script. Really want to bypass the parameter window (since no parameters exist in order to run the exe). Just FYI, I made 1 required parameter using a default text which basically just said "Click OK to run the program."
0 Kudos
KimOllivier
Occasional Contributor III
I just define no parameters for the tool. Then if you add it to the menus using Customise.. you can add the tool as a button. Executing the button will not popup if there are no parameters.
0 Kudos
markdenil
Occasional Contributor III
Making a python add-in to run from a button, or just adding the scipt as a button through the Customize interface is the way to do what you want.
The conceptual being of toolbox tools requires that parameter or OK stage.
You can't make the lepoard change its spots, and it is wrong to try....
0 Kudos
curtvprice
MVP Esteemed Contributor
You can't make the lepoard change its spots


Here's why (I believe): Geoprocessing tools are designed to run asynchronously controlled through messaging so they can run from a server or locally with no modification.

I just define no parameters for the tool. Then if you add it to the menus using Customise.. you can add the tool as a button. Executing the button will not popup if there are no parameters.


Kewl.

If you do have parameters and they don't change, then you could create a model tool with the parameters filled out and drop that into your interface as a button.

  Just FYI, I made 1 required parameter using a default text which basically just said "Click OK to run the program."


John, I think a more effective way to do this would be to place the instructions in the tool "Summary" (in the Item Description editor) so it would appear at right in the tool dialog if your tool was launched that way.
0 Kudos