Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a Python script that I have made to some basic data management tasks. I want to package up a Python script in a nice user friendly way for an end user to run, they do not know how to run Python scipts and I need them to input some parameters in an easy way i.e. say a filename - whats the best way to do this.

Cheers

share|improve this question
    
Does anyone else feel that this question is a duplicate of gis.stackexchange.com/q/18798/4681? –  nmpeterson Jan 17 '12 at 16:20
    
Sorry - yes it is very similar - woops... I'm happy to ditch this question - althought Chad Cooper has put a nice answer down too.... –  Vidar Jan 17 '12 at 18:19
add comment

3 Answers

up vote 6 down vote accepted

Creating a custom tool for use within arctoolbox. There are several sections within the help files that are useful, see this link as a starting point.

share|improve this answer
add comment

Also note that if you're accessing arcpy, you're going to need to install the required software on their computer, including access to an arcGIS license. (I can't say whether you can get by just installing the license manager and the arcgis python installation, or you need to install the entire desktop software package).

I've put python scripts on a number of desktops in my organization for automating functions.

If you're editing using idle, then just save the .py file and have them run it. It'll run through a command line like the one linked above. The combination of modelbuilder and it's 'export to python' option is really quite a timesaver too if you're not too familiar with working with the environment.

share|improve this answer
add comment

You could use a combination of Python's built-in raw_input function and a batch file. Both live in the same directory, the batch file calls the script (so all they have to do is 2X click on the batch file), and raw_input asks them for the needed inputs. Example Python code in untitled-2.py:

name = raw_input("Enter name:")
print "Hello", name

Contents of batch file:

python untitled-2.py
pause

I put the pause in there so we could see the output after I 2X clicked on the batch file:

enter image description here

So all your user has to do is place both the Python script and the batch file in the same location on their box, double-click on the batch file, and enter in whatever is asked of them.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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