I???m trying to return data to a web page from a simple processioning procedure. I keep getting the following error ???self._gp.SearchCursor(*gp_fixargs(args))) RuntimeError: ERROR 999999: Error executing function.??? The processioning function works fine standalone but fails when ran with through CherryPy. I think it???s a pathing issue but haven???t had any luck solving it.[ATTACH=CONFIG]15889[/ATTACH]
Any help would be greatly appreciated.
Code follows as well as being attached with table.
## import cherrypy import arcpy
class StartPage:
def index(self): # This is the starting web page for the HOA selection application return ''' <p><a href="http://TheServerName:8080/get_database" target="_parent">database pull</a></p> <p><a href="http://TheServerName:8080/get_text" target="_parent">text pull</a></p>''' index.exposed = True
def get_database(self): info = data_extract() return info get_database.exposed = True
def get_text(self): return """Great! this worked<p><p><a href="http://TheServerName:8080/" target="_parent">back</a></p> </p>
>> There's WSGI, which is an open standard that allows you to develop in Django, or Pyramid, or web.py, or flask, or any of a number of other options. Flask or web.py are probably your best bet for porting from CGI.
If you run a web application that handles multiple requests in the same process (that is, running a Python WSGI server behind your IIS instance) then you don't incur the overhead of importing arcpy over and over. >>
Unfortunately, I'm not super knowledgeable about the state of Python HTTP on Windows. However, you may find luck with gevent's WSGI server (example) as it uses greenlets in an event loop instead of threaded workers.