CherryPy is a web framework of Python which provides a friendly interface to the HTTP protocol for Python developers. It is also called a web application library. It allows developers to build web applications in much the same way they would build any other object-oriented Python program. This results in smaller source code developed in less time.
This framework is mainly for the developers who want to create a portable database-driven web applications using Python, as it provides Create, Retrieve, Update and Delete functionalities.
The basic requirements for installation of CherryPy framework include ?
- Python with version 2.4 or above
- CherryPy 3.0
To install cherrypy run the following command in terminal:
pip install cherrypy
A simple Application –
A cherrypy Application typically looks like this:
return “Hello World!”
Project to Upload file and read its content –
Steps taken to upload a file and read its content using cherrypy:
- Create any text file to read or existing file can also be used. Geeks.txt file is used in the program.
- Create user interface that upload a file from system
- Write cherrypy program that read the content of file and show its content.
To stop the engine, use the following code:
Output(Before file upload):
Output(After uploading the file):
- How to perform multiplication using CherryPy in Python?
- Perform addition and subtraction using CherryPy
- Introduction to CherryPy
- Environment setup for CherryPy
- Associate user to its upload (post) in Django
- File upload Fields in Serializers - Django REST Framework
- Python program to reverse the content of a file and store it in another file
- Upload files in Python
- How to Upload Project on GitHub from Pycharm?
- Django - Upload files with FileSystemStorage
- How to read from a file in Python
- Read a file line by line in Python
- Read JSON file using Python
- Python program to read character by character from a file
- Python program to read file word by word
- Read List of Dictionaries from File in Python
- How to read Dictionary from File in Python?
- How to read a CSV file to a Dataframe with custom delimiter in Pandas?
- Python Program to Reverse the Content of a File using Stack
- Python program to modify the content of a Binary File
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.