CherryPy - Vocabulary
There are a few important keywords which need to be defined in order to understand the working of CherryPy. The keywords and the definitions are as follows −
|S.No||Keyword & Definition|
It is an interface dealing with the HTTP protocol. Its goal is to transform the HTTP requests to the application server so that they get the responses.
It is a piece of software which gathers information.
It is the component holding one or more applications
Web application server
It is the combination of web server and application server.
The following example shows a sample code of CherryPy −
import cherrypy class demoExample: def index(self): return "Hello World!!!" index.exposed = True cherrypy.quickstart(demoExample())
Let us now understand how the code works −
The package named CherryPy is always imported in the specified class to ensure proper functioning.
In the above example, the function named index returns the parameter “Hello World!!!”.
The last line starts the web server and calls the specified class (here, demoExample) and returns the value mentioned in default function index.
The example code returns the following output −