How do I call a Python script from a html button ?

14190
15
Jump to solution
04-08-2015 11:31 AM
JulieK
by
Occasional Contributor

If I have a web page  form with 'submit' on this simple Javascript API sample, how would I call the Python script on clicking the submit button? any thoughts or ideas?

0 Kudos
15 Replies
TomSellsted
MVP Regular Contributor

Julie,

Yes!  ArcMap is a 32bit application and uses the python 32 bit library.  The module that works successfully in ArcMap must also be installed onto the server.  ArcGIS Server uses a 64bit python library, so you will have to install it again using the 64bit version of the module.  I have had to do the same thing with cx_Oracle for interacting with our utility accounts.

Regards,

Tom

JulieK
by
Occasional Contributor

Tom,

You said it! We installed the tool in 64bit Python folder and it did it!!

thanks a ton:)

have a great day!

0 Kudos
TomSellsted
MVP Regular Contributor

Julie,

Excellent!  Glad you got it working!

Regards,

Tom

0 Kudos
JulieK
by
Occasional Contributor

Is this how I should access the toolbox in a web application?

ArcGIS Help 10.1

0 Kudos
TomSellsted
MVP Regular Contributor

Julie,

Yes!  Be aware that the service for the geoprocessing task by default is asynchronous, so you would use a submitJob to request that geoprocessing task.  If it is a synchronous task, then you would use execute.

Regards,

Tom

0 Kudos
JulieK
by
Occasional Contributor

how do I do this?

' The parameters you are filling in have to be tied to the logic you will use to do the analysis you are trying to run.'

The function in the script accepts two paramaters and the toolbox lets you enter two parameters. how do I tie it together?

0 Kudos