Search code examples
pythoncherrypy

Having trouble understanding CherryPy


I read through the tutorial on the cherrypy website, and I'm still having some trouble understanding how it can be implemented in a modular, scalable way.

Could someone show me an example of how to have cherrypy receive a simple http post to its root, process the variable in some way, and respond dynamically using that data in the response?


Solution

  • Are you asking for an example like this?

    http://www.cherrypy.org/wiki/CherryPyTutorial#ReceivingdatafromHTMLforms

    It receives input from forms.

    You can return any text you want from a CherryPy method function, so dynamic text based on the input is really trivial.