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

Web Server

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.


Application server

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!!!" = True

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 −

Demo Example
Kickstart Your Career

Get certified by completing the course

Get Started