python写脚本打开应用程序错误,从web.py运行时,完美运行的python脚本会产生错误...

I have the following python script which runs perfectly if run separately:

import arcpy

val = arcpy.GetCellValue_management("D:\dem-merged\lidar_wsg84", "-95.090174910630012 29.973962146120652", "")

print str(val)

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).

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()

When i invoke this using http://localhost:8080, i get the following error:

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.

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.

Any ideas as to what might be wrong?

解决方案

That looks like an error from the third party module. Try finding out what that error code (000582) actually means to the application.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值