Note that there are some explanatory texts on larger screens.

plurals
  1. POPerfectly running python script gives error when run from web.py
    text
    copied!<p>I have the following python script which runs perfectly if run separately:</p> <pre><code>import arcpy val = arcpy.GetCellValue_management("D:\dem-merged\lidar_wsg84", "-95.090174910630012 29.973962146120652", "") print str(val) </code></pre> <p>I want to expose this as a web service and so I installed web.py and wrote the following code for code.py. but it gives errors(when invoked. compiles fine).</p> <pre><code>import web import arcpy urls = ( '/(.*)', 'hello' ) app = web.application(urls, globals()) class hello: def GET(self, name): val = arcpy.GetCellValue_management("D:\dem-merged\lidar_wsg84", "-95.090174910630012 29.973962146120652", "") return str(val) if __name__ == "__main__": app.run() </code></pre> <p>When i invoke this using <a href="http://localhost:8080" rel="nofollow">http://localhost:8080</a>, i get the following error:</p> <pre><code>&lt;class 'arcgisscripting.ExecuteError'&gt; at / ERROR 000582: Error occurred during execution. Python C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py in GetCellValue, line 8460 Web GET http://localhost:8080/ Traceback (innermost first) C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py in GetCellValue be returned.""" try: retval = convertArcObjectToPythonObject(gp.GetCellValue_management(*gp_fixargs((in_raster, location_point, band_index), True))) return retval except Exception, e: raise e ... @gptooldoc('GetRasterProperties_management', None) def GetRasterProperties(in_raster=None, property_type=None): """GetRasterProperties_management(in_raster, {property_type}) Returns the properties of a raster dataset. </code></pre> <p>I have tried Debugging it in many ways, the code .py runs fine if i just return a "hello". The library i am using is a ArcGIS Geoprocessing toolbox library.</p> <p>Any ideas as to what might be wrong?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload